In my game, I’ve recently had trouble with Time.deltaTime. I’ve used it before and it had worked fine before but,
now when I use it… my character won’t move. With out it, character movement works fine.
public class Player : MonoBehaviour {
private float inputDirection; // x-value of move vector
private Vector3 moveVector;
private CharacterController controller;
// Use this for initialization
void Start () {
controller = GetComponent<CharacterController>();
}
// Update is called once per frame
void Update () {
inputDirection = Input.GetAxis("Horizontal");
moveVector = new Vector3(inputDirection, 0, 0);
controller.Move(moveVector * Time.deltaTime);
}
}