playMaker

Author Topic: Raycast option to ignore triggers  (Read 4081 times)

hh

  • Playmaker Newbie
  • *
  • Posts: 5
Raycast option to ignore triggers
« on: February 08, 2016, 12:20:05 PM »
It would be useful for the Raycast action to optionally ignore trigger colliders in the scene.

The ideal functionality would mirror Unity's QueryTriggerInteraction enum:
http://docs.unity3d.com/ScriptReference/QueryTriggerInteraction.html

mdotstrange

  • Hero Member
  • *****
  • Posts: 555
    • Can't code? Who cares! Make games anyway!
Re: Raycast option to ignore triggers
« Reply #1 on: February 09, 2016, 03:09:30 AM »
I modified the raycast action to ignore triggers and saved it as a separate action- find it here http://hutonggames.com/playmakerforum/index.php?topic=12202.0

Just had to add QueryTriggerInteraction to this line

Code: [Select]
Physics.Raycast(originPos, dirVector, out hitInfo, rayLength, ActionHelpers.LayerArrayToLayerMask(layerMask, invertMask.Value), QueryTriggerInteraction.Ignore);
Indie game dev and instructor at the Strange School. Learn Playmaker at the Strange School!

dudebxl

  • Hero Member
  • *****
  • Posts: 602
Re: Raycast option to ignore triggers
« Reply #2 on: February 09, 2016, 10:19:47 AM »
+1 to add to ecosystem

@mdotstrange. Thanks you for all the recent actions. Could you possibly put them on the ecosystem (using snipt.net). Many thanks

hh

  • Playmaker Newbie
  • *
  • Posts: 5
Re: Raycast option to ignore triggers
« Reply #3 on: February 09, 2016, 01:35:52 PM »
Thank you.

mdotstrange

  • Hero Member
  • *****
  • Posts: 555
    • Can't code? Who cares! Make games anyway!
Re: Raycast option to ignore triggers
« Reply #4 on: February 09, 2016, 08:16:54 PM »
@hh No prob!

@dudebxl I have just hacked a few together  :) I added them to snipt and they should now show up in Ecosystem- thank you for all your awesome actions! I use them all the time and plan to use the fighter cam one you did soon  :D
Indie game dev and instructor at the Strange School. Learn Playmaker at the Strange School!