I would like to make a homing missile which works in a 2D game, meaning that all the rotation happens only on the z axis.
Sadly functions like LookAt only work in a 3D environment, since they utilize all 3 axis to direct the object.
I also would like the missile to have inertia, meaning, that if the targeted object moves, the missile doesnt make sharp corners but transitions naturaly.
I would be really thankful if you could help me out here.
I’m facing the same problem. I got it fixed-ish by creating an empty gameObject and attaching my 3d missile script, then assigning the X and the Y value of the sprite to be the same of that empty gameObject. It’s not an elegant solution and it might be too much to handle for a mobile devices game and that is exactly my case. Also, every now and then, the empty gameObject will begin to travel on the Z axis and even when the sprite’s tranform.position.z is locked, it looks weird and breaks the game.