Unityengine Collider2D.SendMessageUpwards sends a message to the game objects that are parent to the object that has an attached collider component. This method traverses upwards in the transform hierarchy and sends the message to all scripts attached to the game objects that are parent to the object that has the attached collider component.
In the example above, the OnTriggerEnter2D method is called when the object with this script attached collides with another collider. If the game object attached to the other collider has a tag of “Player”, the SetTarget method is called on the parent objects of the collision object using SendMessageUpwards.
Package Library:
UnityEngine is the package library used in this method.
C# (CSharp) UnityEngine Collider2D.SendMessageUpwards - 30 examples found. These are the top rated real world C# (CSharp) examples of UnityEngine.Collider2D.SendMessageUpwards extracted from open source projects. You can rate examples to help us improve the quality of examples.