How any actor can get direction of movement of other actor?
I want projectile shoting monsters start shooting ahead of a moving target so that the target and projectile will collide. Because mighty cyberdemon with high-tech implant, which cant hit with rockets one bald monkey looks pathetic.
get "pointer" direction of movement
Moderator: GZDoom Developers
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.
Please bear in mind that the people helping you do not automatically know how much you know. You may be asked to upload your project file to look at. Don't be afraid to ask questions about what things mean, but also please be patient with the people trying to help you. (And helpers, please be patient with the person you're trying to help!)
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.
Please bear in mind that the people helping you do not automatically know how much you know. You may be asked to upload your project file to look at. Don't be afraid to ask questions about what things mean, but also please be patient with the people trying to help you. (And helpers, please be patient with the person you're trying to help!)
Re: get "pointer" direction of movement
Predicting shots, eh? Just get actor vel. Vel is Vector3.
Monsters do not use velocity though (only players and projectiles). It would be useless against monsters anyway - their movement is too random. But if you REALLY want to do this with monsters, you'd need to get their direction from "movedir" (see actor.txt in gzdoom.pk3). Monsters move only in 8 directions, so you'd have to calculate this from this and their speed (the speed property). I don't know how, but it would be possible.
Code: Select all
Vector3 targetMovement = Target.Vel;
Re: get "pointer" direction of movement
I make monsters that "move" in full 3D space, but I dont know how make it truly MOVE in 3D space, because I use set origin with interpolations and 3D vectors that point to monster target, with lenght equal to it, monster, speed. Now I have caco which makes loops and kulbit using math black magic.
So, how make monster which truly move in full 3D? I try make so using thrust thing (z) and pythagoras, but I dont know how pick correct slope direction from vector, since dont know how gzdoom computing it.
So, how make monster which truly move in full 3D? I try make so using thrust thing (z) and pythagoras, but I dont know how pick correct slope direction from vector, since dont know how gzdoom computing it.