- Home /
Access other collider without use of Trigger collider.
I'm trying to check if one object (a cube with a rigidbody) is touching another object tagged 'floor'.
When my script is attached to the cube, I dont know how to to access the floor collider.
If I use OnCollisionEnter, the parameters I have to use only give me access the collision points. If I use OnTriggerEnter, I can access the floor object's collider through the parameters, except my main cube object will then fall through the floor because the floor needs to be set to trigger.
Can I do the equivalent of OnCollisionEnter but access the collider of the other object which has been collided with (i.e. my floor)?
Answer by AyAMrau · Jun 27, 2014 at 12:15 PM
When using OnCollisionEnter(Collision collision) the Collision object gives you access to the gameObject and collider that triggered the event: Collision doc
Your answer
Follow this Question
Related Questions
Character collider falls away unless "isTrigger" selected 1 Answer
Inconsistent behaviour in child triggers 1 Answer
Colliding two GameObjects 1 Answer
Colliders that do not collide... 1 Answer