I’m attempting to detect when a gameObject with a Capsule Collider and RigidBody attached it lands on the floor, which is a Mesh with a Mesh Collider attached it to it. Adding a tag to the Floor causes collision issues as other materials comprise the Mesh. The Physics.CapsuleCast seems like the best route, but I’m sure how the call should be made?
Because of how the 3D casting methods work a capsule cast will fail to detect anything if your character is already touching the ground. A better method is to use a SphereCast:
if (Physics.SphereCast(transform.position,0.5f,-transform.up,out RaycastHit hit,0.51f))
{
Debug.Log("We're standing on something!");
}
Thanks for the response. It’s appreciated. Actually, the game object is a Cylinder not a character. A character is tossing the cylinder onto the floor. I probably should have stated this in the initial post. My apologies.