3d raycast extension doesn't work

I’ve tried both default raycast and 3d raycast extension. Nothing works in default 3d.

Btw default raycasting system has been always working for WiththreeJs extension. But nothing works for Default Gdevelop 3d.

“enemy_ray_picked” variable =1 always here even if there are many panel_sprite objects between enemies and player.

The cast a ray only triggers if there’s a test object in between the 2 locations. Since both events are sub events of it, the last event will never trigger. It should work if you remove the last line and add an action to set the value to 0 right before the ray cast.

1 Like
  1. Thank you! It works in general!
  2. But now i’m confused even more:

Why the variable is true when there are Obstacles between a player and enemies and it’s false if there are no any obstacles? It works vice versa :smiley:

1 Like

Because you are casting a ray from enemy to player, and checking if the ray intersects the Obstacle object. It’s true if there is one in the way, and false if not.

1 Like

Get it. Now i understand the logic :melting_face: :+1: