I’m trying to create a simple camera control and I’m failing at the first step, moving the camera forward. When the scene starts I’m using lookat to point the camera at an object.
transform.LookAt(battlefield.transform.position);
Then I have the following code which fires when “W” is pressed:
transform.Translate(transform.forward*Time.deltaTime*cameraMoveSpeed);
My expectation is that the camera will move from its current position toward where it is looking. Instead the camera appears to move down and to the right.
What am I doing wrong?
That's difficult to say. What you've told us here SHOULD work, in theory. Can we see the snippet of code in which this is called?
– DESTRUKTORR