Hi! I am on 2017 31 version.
After animating a crane carrying a container(with a RigidBody Component) along a track, and letting it drop after some frames, I got this error:
Non-convex MeshCollider with non-kinematic Rigidbody is no longer supported in Unity 5. If you want to use a non-convex mesh either make the Rigidbody kinematic or remove the Rigidbody component. Scene hierarchy path “craneTrack/crane/container/container 1”, Mesh asset path “Assets/Models/Environment/container.FBX” Mesh name “container”
But the animation works.
What to do ? This is a RED warning.
Thanks for any help!
Maybe this is due to the hierarchy/component relastionship ?
Here is a screenshot:
As console said, non-convex mesh collider is not possible on non-kinetmatic rigidbody since Unity 5.
If you need a physical simulation of rigidbody, you need to create a several convex colliders inside an object.
But if you don’t need a physical simulation, you can just click “kinematic” checkbox on rigidbody and everything will work without errors. Also you can remove Rigidbody component at all.
Okay so I have run into this same issue. I’m adding torque to an object, however, when I added a mesh collider and set convex to true it does nothing in PIE. I worked around it by setting convex to false in the script for say 20 frames then setting it back to true. My questions would be how bad is this error and what settings would I need to set so I don’t have to flip convex on and off in my code? I haven’t been able to find a solid answer besides, “it isn’t supported.”
private void Start() {
frameCount = 0;
hasOneFramePast = false;
_collider.convex = false;
//generate random rotation
startingRotation = GenerateRandomRotation();
//generate random torque
startingTorque = GenerateRandomTorque();
//generate random mass
rigidBody.mass = GenerateRandomMass();
//set random position and rotation to object
gameObject.transform.SetPositionAndRotation(gameObject.transform.position,startingRotation);
}
private void FixedUpdate() {
//add torque to rigidbody
rigidBody.AddRelativeTorque(startingTorque,ForceMode.Force);
//after force has been applied on the first frame, set bool to true and set
if (hasOneFramePast == false)
{
frameCount++;
if (frameCount >= frameLimit)
{
hasOneFramePast = true;
_collider.convex = true;
}
}
}
Sadly that did not work out for me. What other solution do you suggest?
I still get the error when my Rigidbody is kinematic.
I need my Rigidbody to use no gravity and to be kinematic &
do not want the mesh collider to be convex because it would then collide with other objects.
I need Rigidbody & MeshCollider to work together because XRTK’s XRGrabInteractable depends on them…