- Home /
How to recheck collision?
I can't find anyway to check if there is currently a collision between two objects. I have a ball that is controlled by the user. OnCollisionEnter with a platform makes some variables true, necessary for my dynamic jumping system. OnCollisionExit also causes some variables to change. However, the platforms are moving, and will even move through each other. There is a bug which disallows the player to jump even if he is currently in contact with a platform because OnCollisionExit was called when another platform passed underneath it. The only solution I can think of is to check for a collision manually, which doesn't seem to be possible.
Answer by Fendyk · Aug 07, 2017 at 11:59 PM
You can use OnTriggerStay or OnCollisionStay. It will check collision every frame. However, OnTriggerStay works a bit different.
https://docs.unity3d.com/ScriptReference/MonoBehaviour.OnTriggerStay.html https://docs.unity3d.com/ScriptReference/MonoBehaviour.OnCollisionStay.html
Your answer
Follow this Question
Related Questions
2D 360 degress platformer example needed 0 Answers
Connecting Pipes at points 2 Answers
physics materials not showing up? 1 Answer
CharacterController Physics 1 Answer
How to deal the 2d platform physics? 0 Answers