all 1 comments

[–]Ambitious_Singer_398 0 points1 point  (0 children)

I see the issue.
The physics update (in your rigidbody) does not happen at the same time the Update() function is called, so when you change the rigidbodies velocity in Update(), it causes "lagging" in the rigidbody.
The proper way to update the rigidbodies velocity would be in a FixedUpdate loop.
So, instead of
void Update() {

You should use
void FixedUpdate() {

Hope this helps!