- Home /
Question by
ahadi71 · Sep 12, 2020 at 09:14 AM ·
gameobjectevent triggeringevent handlers
Which game object is calling my script?
I have several game objects that use the same script for their Event Trigger component (specifically Pointer Enter and Pointer Exit ). My question is how can I know which game object is calling the script at each moment?
Comment
void IPointerEnterHandler.OnPointerEnter ( PointerEventData eventData )
{
Debug.Log( $"pointer enter '{gameObject.name}' " , gameObject );
}
Your answer
![](https://koobas.hobune.stream/wayback/20220613011711im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
A lack of basic understanding of events and such 1 Answer
Add Pointer Down event trigger only to parent object. 1 Answer
fire OnSubmit when key released 1 Answer
Parent Event Handler Overriding Child Handler 0 Answers
Setting up EventTrigger programmatically for GameObject throws NullReferenceException 0 Answers