How can an Area3D detect collision from a raycast?

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

Hi, so starting from the beginning, my game uses a lot of 3D Areas that utilize signals like “input event” and “mouse entered/exited”. I recently ran into an issue where my game captures the mouse, which means that these areas no longer detect input from the mouse. So I decided that I should probably make a Raycast projected from the camera and see if I can use that.

I haven’t used Raycasts before much so I’m having some trouble figuring out what I should do from the docs. Is there any way an Area 3D can detect when a Raycast has entered it, and better yet, still detect input (like mouse clicks) when the Raycast is inside it? Any pointers would be appreciated.

:bust_in_silhouette: Reply From: barbaros

raycast has a collide with property, that lets you set if it should collide with an area or body