Reputation: 290
I Have a problem with the OnTriggerEnter2D eventTrigger.
The main problem is to have the OntriggerEnter2D activate whenever the same object(s) re enter the Circle Collider 2D.
Currently I have 3 object that can interact, lets call them A1, A2 and B1. When B1 has entered A1, it works. When B1 has entered A2, it works. But when B1 re-enter A1 it doesnt work. And this also includes if A2 is entered at the start.
All i could find was unity explaining: "Notes: Trigger events will be sent to disabled MonoBehaviours, to allow enabling Behaviours in response to collisions." (http://docs.unity3d.com/ScriptReference/MonoBehaviour.OnTriggerEnter2D.html)
If it's the case that it just totaly deactivate the trigger for OnTriggerEnter2D, is there some kinda way to work around it to make it work like a "OnTriggerEnter2D"?
I know about the OnTriggerStay2D but for me it would just be a waste of process power and at the same time a stupidly poor solution.
Upvotes: 0
Views: 139
Reputation: 150
Depending what you mean by re-enter. If your object never fully detach apart, you won't have a new call to OnTriggerEnter2D.
In that case OnTriggerStay2D is the way to go if you want notification of your object staying on top of another one after initial OnTriggerEnter2D call
Upvotes: 1