Raycast only works on part of instance object

Well, i went with invisible objects and raycast against them

I am having issues that raycast only works on a part of the object, it depends on rotation i think where it works

for example, the black part of the orange/yellow cube in the front only works, the one in the background does not work and it is the same instancedmesh

i know that there are probably many useless updates happening now, i was just trying everything that i could find and see if something solved my issue

Not 100% sure what’s happening there - but you don’t need at least like 75% of that code.

Just create instances as usual - then use raycast as usual. If there’s an intersection - the instance array index will be returned in intersection as instanceId. Absolutely no additional steps needed.