How do I make a RididBody2D outside of a CanvasLayer collide with an area2D inside of a CanvasLayer?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Godotdeveloper3313

It started because first I needed some areas that follow the camera, so CanvasLayer did the job. Inside the CanvasLayers (the layer that follows the camera) I put some areas to execute a script whenever a number of RigidBody objects outside of the CanvasLayer are inside these areas in the layer, however…

Apparently what is inside the canvas layer is treated as a “separate dimension” from normal game layers, is there any way to make the collision among them happen?

Also: the collision happens normally when I put the areas outside of the Canvaslayer so it isn’t any imprudence in the coding.

:bust_in_silhouette: Reply From: Ratty

Not an answer but there is a similar Q & A here : link
Hope this helps!

:bust_in_silhouette: Reply From: SnapCracklins

You would run a check at the usual signal, but for argument you pass a “body” instead of an area. So:

func “on_Area2D_entered”(body):
    If == “yourObjectName”:
        #then your code