Raycast2D doesnt collide with anything

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

Im currently out of ideas on why this suddenly happened while i was working on my game

i was looking at youtube tutorials on ledge hanging and implemented a raycast method
so my raycast wont collide with with an area2D that i created specific for ledge hanging

the ledge has collision layer of 10
the raycast has collision mask of 10

this is the code called during the physics delta function

func LedgeHanging():
	if is_on_floor() and velocity.y < 0 :
		ledgeVCast.enabled = true
		if ledgeVCast.is_colliding():
			print("Vertical Cast true")

thanks for looking

Have you verified that you’re getting past that first if block? If you haven’t, add a unique print statement just inside each of the two if blocks to ensure that you know which part of the logic is failing…

jgodfrey | 2022-09-23 17:49