My rigidbody has mass 1, gravity on. I’ve got a jump function and when I use jump the rigidbody descends at a steady pace so I don’t believe it has to do with the mass and gravity parameters.
If anyone knows what causes this that would help a lot, because I want to know the precise cause rather than tweak things unnecessarily to dampen it.
blue arrow = transform.position Vector3.Lerp start position, and end positon
red circle = where player rapidly descends to. (which is directly below the end position)
“My rigidbody has mass 1, gravity on. I’ve got a jump function and when I use jump the rigidbody descends at a steady pace so I don’t believe it has to do with the mass and gravity parameters.”
That’s likely your issue. When you’re moving an object using transform.position, you should set the Rigidbody’s isKinematic to true.
This is just a guess, but you can run some tests to verify the guess:
I think what’s happening is that your Rigidbody has cumulative force applied to it over time since its isKinematic is false and forces will still be applied on it. The cumulative force is gravity and its mass, so its downward velocity is becoming big, but since FixedUpdate simply performs catchups (and I assume runs just before Update is executed in the same cycle?) you likely wont see this effect until you stop setting the transform.position. By then, the downward velocity value is really big and will cause your Rigidbody to fall quickly since you’re not setting the transform.position directly anymore.
If you need to keep the Rigidbody’s isKinematic false, you might be able to get away with using Rigidbody.MovePosition as opposed to setting the transform.position
Thanks,
What you said is true, I have since made some adjustments and read more about Rigidbody and eventually got a working Zipline using the rigidbody parameters only for the movements.