ray cast functions

the raycast node gives an number output of the distance from the origin to the target it hits. that is very nice.
the problem is it gives it for whatever is furthest away. so if you cast a ray and the ray hits a target the ray doesn’t stop. it keeps going and if it hits another target behind the first this overwrites the data from the first and only send the data from the second hit.

it would be really nice the see the function that you can enable “ray stops after target hit” so you only get the data from the first target.

an example of where this is a big issue is in my “game”. where i made a ray cast renderer. it doesnt render the wall closest to the player when there is a wall behind the first. this is something i cant do anything about as of right now.
(link to my game as example: https://flowlab.io/game/play/1398956 )

would love to hear your opinion on this @grazer

@“JR 01” yeah the ray cast needs some love as its really powerful but you cant customize any of its behavior.
my “3D” world game is an example of how you can use it if you have more control

I believe its the center, the preview is just on the cell block you clicked on to edit the object.

@“JR 01” do ray casts emanate from the center of the sprites actual pixels or from the center of the sprites surrounding grid? For example when setting the raycast angle on a 2x3 grid sprite, the preview of the ray is in a different place depending on where I clicked the sprite to edit the behaviors.

This isn’t so much a bug and more like a feature request. But yeah, the current raycast behavior gets the distance of the furthest object, but having an option to detect the closes object would be great too.

I would also like to see a Hitscan behavior that is like a raycast but as a laser pointer instead (infinite) and detects the first object hit. As well a trigger for the object to know its been ‘hit’.

Idk if this might fix it for you but you could try using a proximity set to use closest object along with the raycast?