Event trigger not triggered but can be Detected using Raycast

I have problem when using Event Trigger in Panel Canvas. I have Scene A and Scene B. In Scene B, the event trigger is working. But in Scene A is not working. I suspect that in Scene A, the Event Trigger is blocked by something. But when i am using Raycast, it can detect what GameObject that my pointer down.

here is my Raycast:

var m_PointerEventData = new PointerEventData(null);
m_PointerEventData.position = Input.mousePosition;

var m_Raycaster = this.GetComponent<GraphicRaycaster>();
List<RaycastResult> results = new List<RaycastResult>();

m_Raycaster.Raycast(m_PointerEventData, results);

 if (results.Count > 0) {
         
     foreach(var r in results){
          Debug.Log("Hit " + r.gameObject.name);
     }
        
}

here is my Event trigger:

var trigger = this.GetComponent<EventTrigger>();
 var entry = new EventTrigger.Entry
 {
       eventID = EventTriggerType.PointerDown
 };
entry.callback.AddListener((data) =>
 {
       // some code here
 });
trigger.triggers.Add(entry);

My question is:

  1. How Event trigger Works? How can it different by using Raycast?
  2. Any Solution to fix my event trigger?

Ok, my current solution is to refactor my event trigger and change to Raycast. It so flexible using Raycast rather than Event Trigger. don’t know what side effect

I’m not too familiar with your current problem, as my code structure differs from the way most people do stuff. But if you have something work perfectly fine in one scene, but doesn’t work in another, then something is different or missing.

So you just gotta boil it all down, and find out exactly how it works in the first scene, and make sure everything is exactly the same in the second scene.

My problem is my prefab that has event trigger but can not detect mouse down click on another scene