06-05-2024, 02:38 PM
Im getting this error
If I manually set my Game Object Rigidbody to Kinematic during runtime, I keep getting this error. Its coming from ObiRigidBody.cs
Any idea that I could suppress or get rid of this warning? Im using latest 6.5 version with Unity 2023.2.19f
Code:
Setting linear velocity of a kinematic body is not supported.
If I manually set my Game Object Rigidbody to Kinematic during runtime, I keep getting this error. Its coming from ObiRigidBody.cs
Code:
private void UpdateKinematicVelocities(float stepTime)
{
// differentiate positions/orientations to get our own velocites for kinematic objects.
// when calling Physics.Simulate, MovePosition/Rotation do not work correctly. Also useful for animations.
if (unityRigidbody.isKinematic)
{
// differentiate positions to obtain linear velocity:
unityRigidbody.velocity = (transform.position - prevPosition) / stepTime;
// differentiate rotations to obtain angular velocity:
Quaternion delta = transform.rotation * Quaternion.Inverse(prevRotation);
unityRigidbody.angularVelocity = new Vector3(delta.x, delta.y, delta.z) * 2.0f / stepTime;
}
prevPosition = transform.position;
prevRotation = transform.rotation;
}
Any idea that I could suppress or get rid of this warning? Im using latest 6.5 version with Unity 2023.2.19f