3 Replies
So here, I'm calculating the direction between some target and where the projectile currently is. Then I keep moving the projectile to the target until it reaches it. The issue is, when it does reach it, it's very jittery, oscillating back and forth rapidly and correcting itself until it settles onto the target a few seconds later. Am I doing this badly?
sounds like if your projectile is too fast, it is too far away in one frame, and the next frame already on the other side out of the min dist?
@Ab If your velocity is so big that even
velocity * deltaTime
is greater than the distance, you'll overshoot, then keep overshooting in the other direction, getting you this oscillation
A really simple fix would be to maximize the step length you take in the distance to the target
Something like this (pseudocode, written in chat):