I'm relatively new to Godot and GDScript, but am learning rapidly so I've started trying to make a 2D platformer where you can move around, and climb and slide on walls, jump from walls and stay on walls. I'm using raycast2D going from the player on the x axis to detect when the player is touching an area2D (in this case a tile that is also a staticbody2D). To test this, I wrote:
onready var raycast = get_node("RayCast2D")
func _physics_process(delta):
if raycast.collide_with_areas == true:
print("area")
The problem I'm having is the console is printing area all the time, which means that all of my tiles are area2Ds (some of them are just staticbody2D). Why are all my tiles area2Ds ?
question from:https://stackoverflow.com/questions/65854268/godot-raycast2d-area-detection-not-working