So, over the past while, I’ve been working on a simple arcade flight “Simulator”, and now have come to the point where I need to get enemy aircraft to be capable of following the player’s jet. How would I go about accomplishing the rotations to allow the vehicles to dynamically bank and turn?
I need the enemy aircraft to be able to bank and roll to accommodate it’s turning and movement.
You can use transform.LookAt to follow. or subtract the position of the enemy’s jet from player’s jet to get a vector3 and set transform.forward of the enemy’s jet to it.
So the enemy’s jet can see your jet. Then you can use addforce or constant velocity to move the enemy’s jet in the z direction(forward direction).
It is awful to change transform.forward of the enemy’s jet suddenly so use lerp function or another functions to smooth changing.
I’m guessing you haven’t noticed that Unity standard assets come with a pretty comprehensive plane A.I…
Just go Assets → Import Package → Vehicles and drag the AircraftJetAI into your scene.