hi!
First of all im new to scripting.
I have done intense searching in the unity answers, the forum and the script reference but i can’t get a solution…
I use mouse-x and mouse-y input to move a 3rdperson player. (the x & y movement of the mouse should be translated to moving the character forward, backwards, left and right) Mouse-x also give a slight rotation so you can steer the player. But rotating doesn’t influence the direction of the x and z axis. So when i rotate 180 degrees and I Make a forward input, the player just moves backwards along the original and unchanged z-axis
heres my script:
function Update () {
transform.position.x -= (Input.GetAxis(“Mouse X”) * 0.04);
transform.position.z += (Input.GetAxis(“Mouse Y”) * 0.04);
transform.rotation.y -= (Input.GetAxis(“Mouse X”) * 0.01);
}
I know it has something to do with transform.direction but from all the examples I stumbled upon, they all work with key input * speed as input, while i have raw numbers from the x and y movement of the mouse. My scripting knowledge is to narrow to make these things compatible.
Can anyone push me in the right direction?
Thanks in advance, any advice will be greatly appreciated!
Laurens.