- Home /
Movement with the cursor?
Hey. I want to make a game like this. How can I get the ships movement to work(where the ship rotates to look at the mouse cursor)? I have tried several things (using a look at function, trying to use the mouse look script to work on objects, etc.) but nothing is working correctly Thanks
Answer by Alec-Slayden · Apr 25, 2011 at 08:58 AM
Pretty smooth game. I'm not certain, but if I had to guess I'd say making use of ScreenToWorldPoint for the 'target' the ship points to, along with creating a Spring Joint to connect to the ship. This would also need a custom script to maintain proper rotation.
Alternatively you could use the Screen to world point and have the ship object LookAt the target and constantly Lerp to the world position X / Y.
He mentions the use of iTween, which is a free utility for Unity you may want to look into, because it might have the answer (I'm not familiar with its workings myself).