c# - Input.GetAxisRaw not working? not moving horizontal -


public float movespeed = 0.0f; public float maxmovespeed = 30f;  private vector3 input; private charactercontroller controller;  void update () {      input = new vector3 (input.getaxisraw("horizontal"), 0, 0);             controller.move (vector3.forward * movespeed * time.deltatime);      if (getcomponent<rigidbody> ().velocity.magnitude < maxmovespeed) {                 getcomponent<rigidbody> ().addforce (input * movespeed);     } } 

i want player keep moving forward not moving left , right. there no errors. suspect logic flaw can't figure out.


Comments

Popular posts from this blog

amazon web services - S3 Pre-signed POST validate file type? -

c# - Check Keyboard Input Winforms -