please give me JS script on how do i make a gameobject move with:-
- Uparrow - Move Forward
- Leftarrow - Turn/Rotate left
- Rightarrow - Turn/Rotate right
with comment '//' to explain me the script
please give me JS script on how do i make a gameobject move with:-
with comment '//' to explain me the script
This answer explains a simple movement script. Unity Answers Link to Character Motion
The important thing to notice in this script is the
moveDirection = transform.TransformDirection(moveDirection);
because that makes the movement relative to the current direction of the player, not world space.