Multiple targets for raycaster


#1

Morning all… I’m implementing a raycaster to react to menu icons… currently intersections between raycaster/plane activate all the defined states not just the one specific to that intersection…

i.e…

symbol.nodes.Raycaster.on(“intersectionenter”, (e) => {
equilibrium_open.activate();
billboards_unseen.activate();
}

…will on intersection also run states defined on other planes. I’m not totally up on scripting so can I define the specific plane (Menu_discs-01) within this script so the others don’t activate?

Hope that makes sense!! :smile:


#2

Hi @stephen.bedser,

The intersectionenter intersection event provides information on the node that triggered it. You could then set up a switch statement to activate a certain state depending on the node that triggered the event. You can check out the Intersection Event documentation for more information.

Hope this helps.

All the best,
Seb