Hi all! I'm trying to get this card sorting Godot 4.x project to work on a canvas layer; I want the cards to stay in the foreground on the UI while the camera pans across a scene in the background. But I just can't get it to work.

Once the CardHand node (which contains the individual cards) is a child of a CanvasLayer node, Godot stops detecting collisions. Originally I thought this might have to do with the fact that the project uses intersect_point and not intersect_point_on_canvas but that method appears to have been removed in Godot 4.0 and I can't find what, if anything, replaced it.

Is there a proper way to adapt a Godot 4.x project that uses intersect_point to work on the canvas layer? More specifically, how can I get this particular project working on a canvas layer? Thanks for any insight, I'm stumped!

    d4edalu5 Can you share a script and node layout in the scene? Otherwise just put the card node into a node and connect the events of the mouse not to canvas layer but the child of the canvas layer wich contians your cards.

    Thanks for following up! Just this morning I figured out what I was doing wrong. I didn’t set/update the canvas instance ID which I needed to do as I was adding another canvas layer to the project.

    In case it’s useful to anyone as clueless as me, here’s the updated code:

    Task<Array<Dictionary>> raycastQuery = GetRaycastQuery(new PhysicsPointQueryParameters2D()
    {
    Position = GetGlobalMousePosition(),
    CanvasInstanceId = hudNode.GetInstanceId(),
    CollideWithAreas = true,
    CollideWithBodies = false
    });