playMaker

Author Topic: How do you trigger a No Hit Event for when raycast hits nothing? [solved]  (Read 3619 times)

createasaurus

  • Full Member
  • ***
  • Posts: 146
I am making an enemy player AI.  I want him to stop when he reaches a cliff that is too high.

I put a raycast with -1 on Y (pointing down) and set the distance to 1.5.  My hope was that the raycast would constantly hit the terrain mesh.  Then when the terrain mesh dropped out by more than 1.5... BAM - it would trigger a No Hit Event for full stop.  Unfortunately, I do not see a No Hit Event in the raycast action.  Is there a way to do this, or is there a different approach to this problem that you could recommend?

Thank you very much,
Createasaurus
« Last Edit: September 24, 2014, 02:51:43 PM by createasaurus »

createasaurus

  • Full Member
  • ***
  • Posts: 146
Re: How do you trigger a No Hit Event for when raycast hits nothing?
« Reply #1 on: September 24, 2014, 12:53:46 PM »
Hmmm... maybe if I look into the Store Hit Distance.... and check if the distance is greater then X...  I going to be experimenting along these lines next.

terri

  • Sr. Member
  • ****
  • Posts: 386
    • terrivellmann.tumblr.com
Re: How do you trigger a No Hit Event for when raycast hits nothing?
« Reply #2 on: September 24, 2014, 01:06:06 PM »
or you could also store collider info and do a check on that

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2511
  • Mender of the past
    • Cleverous
Re: How do you trigger a No Hit Event for when raycast hits nothing?
« Reply #3 on: September 24, 2014, 01:31:05 PM »
Try this action

http://hutonggames.com/playmakerforum/index.php?topic=5406.msg28956#msg28956

I didn't make a thread for it, never got around to polishing and finishing it but it should work.
Products by Cleverous
|| Vault Core : Database
|| Vault Inventory : Multiplayer Inventory
|| Vault Attributes : Character Stats
|| That Hurt! : Dmg Floaties
|| Quinn : 3D

createasaurus

  • Full Member
  • ***
  • Posts: 146
Re: How do you trigger a No Hit Event for when raycast hits nothing?
« Reply #4 on: September 24, 2014, 02:38:08 PM »
@Lane, there is a Raycast 2 custom action???!!!  NICE!!!
I have it loaded and will be testing out the No Hit Event.

@terri, Thanks I'll check this out if the custom action is a no go.
« Last Edit: September 24, 2014, 02:47:46 PM by createasaurus »

createasaurus

  • Full Member
  • ***
  • Posts: 146
Re: How do you trigger a No Hit Event for when raycast hits nothing?
« Reply #5 on: September 24, 2014, 02:51:27 PM »
Nice!  The Raycast 2 action's additional functionality has what I need.  I have a RayCast 2 pointing down at a 1.5 length.  It has a No Hit Event which fires off if there is no floor underneath at a distance of 1.5 or greater.  No more enemies blindly walking off cliffs!  Thank you.