How do I make a ray only give preference the first object it hits, and only hide the objects when they are covered by another object
I want a “npc” look for the targets available and visible, giving preference the ones that are the nearest
Hi, for your second image, that’s exactly what a raycast does. Here is the description in the engine:
For your first image you would need several raycasts obviously and you could compare the distances between the ray generator and the objects that intersect the ray. Another option is to use “Pick nearest object”.