Hi,
I never developed for unity, but i did a lot of work for 2d using hge/oslib(psp).
So i’m a little lost now.
I created the following code:
if(Input.GetKey(KeyCode.A))newValues[1]-=this.turnSpeed*(float)Time.deltaTime;
if(Input.GetKey(KeyCode.D))newValues[1]+=this.turnSpeed*(float)Time.deltaTime;
transform.Rotate(0, newValues[1], 0);
if(Input.GetKey(KeyCode.W))newValues[0]+=this.speed*transform.forward.magnitude*(float)Time.deltaTime;
if(Input.GetKey(KeyCode.S))newValues[0]-=this.speed*transform.forward.magnitude*(float)Time.deltaTime;
transform.position = new Vector3(transform.position.x, transform.position.y, (float)newValues[0]);
newValues[1]=0;
So, when i rotate and move he rotates ok, but it moves like the cam never rotated.
If i move 10 degrees to the right the movement stills in the only in the z axis.
How i correct that?
Thanks