Fixed in Next Version

Setting RigidbodyTimeline3D.isKinematic doesn't 'take' until the next update.

Schazzwozzer 6 months ago • updated by Lazlo Bonin (Lead Developer) 4 months ago 2

A few months ago I posted a similar Topic, but when I examined my test case again I couldn't reproduce the original error. However, I think I've now stumbled upon it again.

Simply, if I have a kinematic Rigidbody with a Timeline, toggle isKinematic to off, and then immediately add force, the force is not applied.

The operative code is really just this:

timeline.rigidbody.isKinematic = false;
timeline.rigidbody.AddForce( new Vector3( 5, 0, 0 ), ForceMode.VelocityChange );

If all of the code is executed directly through the Rigidbody (rather than through Timeline), it works just as expected.

I assume what's happening is the change to isKinematic is not actually applied until the next update, but the force is applied before then?

I'm not entirely sure how best to work around this. I could use a coroutine to delay the AddForce() by one update, but that might end up getting messy before long.

Chronos Version:
Unity Version:
Under Review

Sorry for the very late reply. I'll look into this.

Fixed in Next Version

Hi Schazzwozzer,

Thanks a lot for the in-depth report. I've found the cause and it will be fixed in the next version.

Basically, if the time scale is positive, the isKinematic change will be applied to the body instantly instead of waiting for the next frame. This will also apply to 2D rigid bodies and their bodyType property.