I was wondering how I could approach making a projectile move in a way that moves behind the origin for a bit that ramps up in speed and moves toward the target. Heres an example of an enemy that does something like this with its needle attack. @:0:49
Just shoot the projectiles out with the specified original velocities for that pattern, and over time have them seek towards the target in a typical “homing missile” fashion. You can add a delay before the homing behavior starts as well if you want.
Yes! What @PraetorBlue says… see my handy attached Missile Turn Towards packages if you want a start on the whole “turn towards” mechanic.
There’s two examples, one for 2D and one for 3D… go nuts!!
9072451–1255234–MissileTurnTowards.unitypackage (12.1 KB)
9569911–1354120–MissileTurnTowards3D.unitypackage (216 KB)
A simple way to look at this is that it’s basically the same as what we do with gravity and jumping characters. We apply a constant force downwards and apply a brief upwards force to our characters to make them jump and the gravity then pushes them back down to the ground. And if we make the character run at the same time as it jumps then it moves along a curve.
So spawn a projectile at the back of the blue circle and apply a “jump” force in the negative blue.transform.forward axis with some up force mixed in and then apply a constant force to the projectile in the direction of the red circle.
That seems simple enough thank you!