Steer the player
Tutorial
·
Beginner
·
+10XP
·
45 mins
·
(27)
Unity Technologies

1. Overview
2. Set up the Player GameObject
3. Add required physics components
4. Create the PlayerController script
5. Detect mouse clicks
6. Log the mouse position
7. Convert mouse position to world space
8. Rotate the Player GameObject to face the mouse
9. Apply thrust in mouse direction
10. Normalize the direction variable
11. Handle collisions
12. Clean up your code
13. Final script sample
Optional Step