How to use raycast2D to detect collision?

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

I’ve tried using the area2D method but it didn’t work, so I’m trying this one instead. Does anyone know how to do it and could you possibly show some script?

I’ve tried using the area2D method but it didn’t work

What exactly have you tried? And why didn’t it work? What happened?

How to use raycast2D to detect collision?

See my answer over here.

njamster | 2020-09-13 21:03