- Home /
check if two colliders Rub against each other
I have 2 box colliders which can undergo and detect collisions when the cubes attached to them do so .Now i need to detect whether the cube are rubbing against each other for some time and not just colliding .please help .(see the pic).
rub.png
(226.4 kB)
Comment
Answer by Noob_Vulcan · Mar 15, 2015 at 06:28 AM
You can do that by using OnCollisionStay(Collision)
.
OnCollisionStay is called once per frame for every collider/rigidbody that is touching rigidbody/collider.
So you can set a timer in this and do your stuff.
For more refer
http://docs.unity3d.com/ScriptReference/MonoBehaviour.OnCollisionStay.html