Posted October 30, 2023 by kindeyegames
Add raycast triggers and modes: closest, any, all
For modes 'closest' and 'any' there is only one raycast result and it is synchronous, so it is optional to use triggers, the data is available after the raycast event.
For mode 'all' - raycast triggers are generated for every body that the raycast hit and the RaycastResult data reflects the data for each hit. In this way all of the hits in mode all can be processed as they cause a trigger.
If raycasts don't hit any body, a trigger is still generated, but the hasHit value will be 0 (false).