[CC - 3.3.2] - How to detect 2D node from a given Coordinate

Hello fellow CC Devs!

I have an issue…

I assigned a global mouse events like this:

systemEvent.on(SystemEvent.EventType.MOUSE_DOWN, this._mouseDown, this);
systemEvent.on(SystemEvent.EventType.MOUSE_UP, this._mouseUp, this);
systemEvent.on(SystemEvent.EventType.MOUSE_MOVE, this._mouseMove, this);

I want to some how “raycast” the ui mouse position so I detect the a which node is intersect with it.
Is that possible?

The reason I am doing this is because “MOUSE_MOVE” event is only apply on the node and it is not good for me… :frowning:

I can ask engineering to have a look.

NewProject_7.zip (44.4 KB)
You can use this demo to test and see if it is the effect you need.

Its not really working…
However, based on the code, this is not What I need.

Lets say I am hovering the mouse and then the mouse cursor is on a node or object.
In 3D I am using ray cast to detect this.

In 2D, How will I accomplish it?

Your component is doing something else… nice one, but not what I needed… :frowning:

Look at this demo again
It’s closer to what you need, I use 2D collision detection to detect nodes.
NewProject_7.zip (48.4 KB)