Hi there!
I am relatively new to Unity, and am wondering why the following script causes my character to move mainly to the left and slightly forwards, rather than directly forwards. Also, the character controller moves at a slower speed than what the speed variable is assigned to. I have tested changing transform.forward to transform.right, -transform.forward, and -transform.right, all which work perfectly (correct direction and speed).
Note that I have assigned the Character Controller to the controller variable via the Inspector menu for better performance, so that is not a problem here. This script is being used for a Temple Run style mobile app, but in first person. Any help would be greatly appreciated, as I have spent far too much time on this simple problem!
var speed : float = 6;
var MoveDirection:Vector3;
var controller : CharacterController;
function Update()
{
MoveDirection = transform.forward * speed;
controller.Move(MoveDirection * Time.deltaTime);
}
Edit: I have noticed that once the character controller reaches the edge of the platform, it drops down a tiny bit on the y axis and shoots forwards.