- Home /
Question by
Assassins_ · Jul 30, 2021 at 05:01 PM ·
ontriggerstay
OnTriggerStay2D does not always work!
As Unity itself says:
OnTriggerStay2D is called every frame for all Collider2D.
I ran into a problem that when I stand in this area, Debug.Log starts to work for me 53 times and stops, if I move (but still stand in the area), it will work again and stops, I cannot understand what the problem is?
private void OnTriggerStay2D(Collider2D collision)
{
Debug.Log("Stay");
}
Comment
Best Answer
Answer by Assassins_ · Jul 30, 2021 at 05:28 PM
Because of unity optimization(sleeping mode on rigidbody)
Your answer
Follow this Question
Related Questions
Check how many objects are in a trigger? 1 Answer
Editor vs Build: OnTriggerStay & Physics Issues 0 Answers
Why is my 2D Collision Delaying or Missing? 0 Answers
Ask for trigger-collision inside Update() 1 Answer
flamethrower 2D not hitting sometimes 2 Answers