I need help for a strange problem because I'm a noob :(

This is my script :


You can see that I used some code to do an effect when something with the tag “NightPoulet” enters the Collider2D’s surface (with “Is Trigger” On). And it works!

Then, I did a script activating and deactivating the GameObject with this script. I wanted the script to do the effect again if the thing with the tag “NightPoulet” is still in the Collider2D’s surface, but the script wont work in that case!

In fact, for the effect to be done once again, the tagged thing have to get out and back into the surface while the GameObject is deactivated?!?

So I need something to “reset” my script, or any other solution.
…
Anything, please?

You are using OnTriggerEnter. An object only enters a collider event once (per collision). You could read about OnTriggerStay.

1 Like

Thank you

1 Like

Just tested and… nope! that doesnt work differently!?!
OnTriggerStay doesnt seem to work better. Strangly, it works the same way as OnTriggerEnter.

Could you post your activation script?