Was actually able to find something similar in the forums. Basically the rigidbody component needs to be set to "Never Sleep" otherwise it apparently needs to move before activating again?
My Trigger detection doesn't work when i reactivate the object it's on,Detect OnTriggerEnter2D after deactivating and reactivating the object
I have a GameObject with a PolygonCollider2D set on isTrigger = true, and this GameObject is deactivated. There's another Object on top of the now deactivated Trigger Object, and in it there's a script that logs something into the console when it Enters, Stays and Exits the Trigger.
The Trigger item at one point activates, then deactivates.
The FIRST time this happens, everything is fine. It logs everything into the console, and the system seems to work. But the second (and all the other) times i reactivate the object, nothing happens. The only way for something to happen is to move the Trigger Object, even if just a little bit.
I don't know why this is happening, but I keep on getting stuck on collide events when making games with unity, and I'm so sick of it. Please help me.
Here's a small video of my screen, so you can see what i mean: https://youtu.be/ibyfjV_Zek4
make sure you're not using start and awake functions if you're just deactivating it because the start function is called when the play button it first activated and the awake function is called when the object is first brought into the scene.
update should be used to apply the objects attributed all the time, that way if you reactivate it, it can re-apply anything you told it to do in that frame.
Follow this Question
Related Questions
How to activate an object IF player enters trigger? 0 Answers
Unity Tests Deactivates Test Object 0 Answers
Find and turn off previous camera? 1 Answer
disable gameobject after rotation limit 1 Answer
SetActive not working as should 0 Answers