How do i tell if 2 parts are touching?

I have a character and I have a part that the character can walk on. but it has edges. so character can fall off. I dont want it to fall off. can someone help? I’m new to unity and dont know how to tell when 2 parts are touching

You can use two box colliders, which are components - like a rigidbody, that are bounding boxes for where a collision might occur.

Then, in your script, you can use the method:

void OnCollisionEnter(Collision CollisionInfo)


Which is called whenever two box colliders, or two parts touch. You will also need a rigidbody on one of the objects with a collider on to recognise a collision. Hope this helps @BuggyOne