Add raycast triggers and modes: closest, any, all


Add raycast triggers and modes: closest, any, all

  • Add OnAnyRaycast Result - regardless of tag
  • Add OnRaycastResult(tag) - only Results marked with 'tag' cause the trigger

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).

Files

mikal_cannon_3d_physics-1.13.0.c3addon 85 kB
Oct 30, 2023
Raycast triggers.c3p 1,013 kB
Oct 30, 2023

Get Construct 3 3D Physics

Buy Now$10.00 USD or more

Leave a comment

Log in with itch.io to leave a comment.