- Home /
Question by
HernandoNJ · May 07, 2020 at 11:49 PM ·
rigidbodyinputfixedupdaterigidbody.addforceupdate function
Input and Rigidbody (Update and FixedUpdate)
I have been looking for a good answer, but it seems there is so much confusion about it. What would it be if I make something like this
public float horizontalInput;
public Rigidbody rb;
void Start() { rb = GetComponent<Rigidbody>(); }
void Update() { horizontalInput = Input.GetAxis("Horizontal"); }
void FixedUpdate() { rb.AddForce(Vector3.right * horizontalInput); }
Maybe part of the horizontalInput could be lost in FixedUpdate?
Comment
Your answer
Follow this Question
Related Questions
How to add force in direction of vector 2 from new input system 0 Answers
Is it okay to use ForceMode.VelocityChange in Update()? 1 Answer
Ball moving much faster forward when there is horizontal input 0 Answers
how to have a fixed movement using rigidbodies without animations 0 Answers
Not registering input when checking input in Update and using input in FixedUpdate 1 Answer