Question by
PaulaD99 · Sep 04, 2017 at 05:29 PM ·
movement scriptcamera rotate
How do i walk in the mouse direction?
Hello! I'm a beginner in Unity, so I'm still learning a lot of its basic functions.
I've got a room which I imported from cinema 4d, a player (a capsule with a camera attached), and the mouse cursor is locked in the center of the window.
The player is able to walk forward, backward and sideways, also the camera rotates with some limitations.
But what I want to achieve is the player moving forward in the mouse cursor direction, so if i rotate the camera to the left, the player moves in that direction.
My first though was to change the coordinates to match the camera's but I don't know if it is a good approach and I have no idea how to do it. I hope you can post some code to help me with this. I'm coding in C#, Thanks!
Comment