Skip to main content
1 of 2
FxIII
  • 4k
  • 21
  • 20

Ok, I am in favor of creative solutions, really! I like when dynamics are modelled after unrealistic physic, why not?

But there is a limit to everything.

Ok I will not tell you that is unrealistic to use directly velocity when our world is regulated by forces and accelerations. Who am I to say? But let's use the velocity in a consistent manner at least!

You did a perfect reasoning: use the vector to move from my position to my target: well this is the meaning of the term vector; you simply forgot the speed.

The velocity is realy a vector: a speed and a direction: if you forget to both normalize the difference vector or apply the bullet speed on it (multiplying a unit vector for a scalar), you are basically saying that if you are close to the target (the difference vector is hence small) the bullet slows down; while if you are far away the bullet speed is larger.

Ok, this is the underlying problem: direction + speed. Now you can do homing (basically follow the target's changes of direction) or predict the impact position as other answer are telling.

Master those concepts is important in my opinion and, by doing wrong, you discovered a way to make an entity to follow another without ever reaching it (at least as long as deltaTime remains below the unit)

FxIII
  • 4k
  • 21
  • 20