Hello !
I am trying to run a particular script when my Player is walking on a specific area on the ground. I tried to do that with OnTriggerEnter but it is not working at the moment so I was wondering if there was something special to do on the AC Player side.
My "area" on the ground is basically a GameObject with a Polygon Collider 2D on it, IsTrigger is True.
My AC Player has Circle Collider 2D on his feet, IsTrigger is False. He also has a Rigidbody 2D Dynamic.
For now on the coding part I just did a Debug.Log to see if it was triggered but nothing is happening
void OnTriggerEnter(Collider other)
{
Debug.Log("Go !");
}
Is there something changeable on my Player side or is it entirely a Unity problem ?
Thanks in advance !
It looks like you're new here. If you want to get involved, click one of these buttons!
Comments
For 2D objects, you want OnTriggerEnter2D - not OnTriggerEnter.
The AC Trigger 2D logic type, listed in the Scene Manager, provides this functionality as well.
Wow great, thank you very much, it works like a charm !