Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Setting linear velocity of a kinematic body is not supported
#1
Hello,

We are currently in the process of upgrading our project from Unity 2020.3.26f1 to Unity 2022.1.17f1

We get spammed by this message

Quote:Setting linear velocity of a kinematic body is not supported.
UnityEngine.Rigidbody:set_velocity (UnityEngine.Vector3)
Obi.ObiRigidbody:UpdateKinematicVelocities (single) (at Assets/Obi/Scripts/Common/Collisions/ObiRigidbody.cs:34)
Obi.ObiRigidbody:UpdateIfNeeded (single) (at Assets/Obi/Scripts/Common/Collisions/ObiRigidbody.cs:47)
Obi.ObiColliderWorld:UpdateRigidbodies (System.Collections.Generic.List`1<Obi.ObiSolver>,single) (at Assets/Obi/Scripts/Common/Collisions/ObiColliderWorld.cs:378)
Obi.ObiUpdater:BeginStep (single) (at Assets/Obi/Scripts/Common/Updaters/ObiUpdater.cs:55)
Obi.ObiFixedUpdater:FixedUpdate () (at Assets/Obi/Scripts/Common/Updaters/ObiFixedUpdater.cs:46)


and this one

Quote:Setting angular velocity of a kinematic body is not supported.
UnityEngine.Rigidbody:set_angularVelocity (UnityEngine.Vector3)
Obi.ObiRigidbody:UpdateKinematicVelocities (single) (at Assets/Obi/Scripts/Common/Collisions/ObiRigidbody.cs:38)
Obi.ObiRigidbody:UpdateIfNeeded (single) (at Assets/Obi/Scripts/Common/Collisions/ObiRigidbody.cs:47)
Obi.ObiColliderWorld:UpdateRigidbodies (System.Collections.Generic.List`1<Obi.ObiSolver>,single) (at Assets/Obi/Scripts/Common/Collisions/ObiColliderWorld.cs:378)
Obi.ObiUpdater:BeginStep (single) (at Assets/Obi/Scripts/Common/Updaters/ObiUpdater.cs:55)
Obi.ObiFixedUpdater:FixedUpdate () (at Assets/Obi/Scripts/Common/Updaters/ObiFixedUpdater.cs:46)


Upon investigation, we saw this message from a Unity dev https://forum.unity.com/threads/kinemati...st-7822350
and also noted that they added this line in the 2022.1 docs (last line at the bottom)
Quote:Additionally, setting the linear velocity of a kinematic rigidbody is not allowed and will have no effect.

The obi code actually checks if the body is Kinematic before setting the velocity and angularVelocity.

We'll comment this code out since it's not suppose to affect anything.

Is this code suppose to be useful or is it obsolete?

Cheers
Reply
#2
(30-09-2022, 08:35 PM)bagelbaker Wrote: Hello,

We are currently in the process of upgrading our project from Unity 2020.3.26f1 to Unity 2022.1.17f1

We get spammed by this message



and this one



Upon investigation, we saw this message from a Unity dev https://forum.unity.com/threads/kinemati...st-7822350
and also noted that they added this line in the 2022.1 docs (last line at the bottom)

The obi code actually checks if the body is Kinematic before setting the velocity and angularVelocity.

We'll comment this code out since it's not suppose to affect anything.

Is this code suppose to be useful or is it obsolete?

Cheers

Hi!

For the most part, this can be commented out without adverse effects. Commenting this code out will disable continuous collision detection for kinematic objects, so if you have fast objects that move by setting their transform position directly, they will use static collision detection instead.

This is a known issue that has been fixed, not yet published: up until 2022, Unity allowed to write rigidbody velocities even if the rigidbody was kinematic. Obi 7 will contain a fix for this issue.

kind regards,
Reply