OnTriggerStay fails to record a collision if it is not in front of the player

So I noticed this a few times, the timer goes above 1f even when it is colliding with a tree but the tree has to be not in the sight of the player. Look at the image below.

The player is looking in the x direction, as there are no trees in sight, the time since last frame counter goes on incrementing.
But when paused and looked in the Scene view, it shows that there are trees present in the box collider just not in sight of the player. This should cause the counter to reset to 0 but it doesn’t.

What could be going wrong?

2 Likes

Can you post code from ‘ClearArea’ script?

Privacy & Terms