playMaker

Author Topic: OnTrigger Exit Problem  (Read 2934 times)

tim.holman

  • 1.2 Beta
  • Playmaker Newbie
  • *
  • Posts: 49
OnTrigger Exit Problem
« on: January 04, 2012, 07:01:21 PM »
I'm setting up zones for a golf game to change the rigid.body drag and angular drag values when entering certain zones. I've made custom models to fit each zone (i.e. an object to fit in the sand trap), applied a mesh collider, and checked Is Trigger true. When the golf ball enters the zone, it does in fact set off the trigger as it's suppose to. However, when I hit the ball out of the bunker, I can't seem to initiate the TriggerExit function.  I'm using continuous dynamic collision, so collision detection shouldn't be the problem here.

Am I correct in believing that the TriggerExit function SHOULD execute after the ball has been hit into then out of a trigger? Or am I missing something here?

I'd also like to clear up another issue while I'm on the subject. Because playmaker uses finite states, what is the purpose of using OnTriggerStay rather than OnTriggerEnter? I understand that OnTriggerStay calls every frame, but if an event is being sent to another state either way, why would it matter?  ???

Andrew.Lukasik

  • Full Member
  • ***
  • Posts: 134
    • my twitter @andrewlukasik
Re: OnTrigger Exit Problem
« Reply #1 on: January 05, 2012, 02:33:57 PM »
(...) I'd also like to clear up another issue while I'm on the subject. Because playmaker uses finite states, what is the purpose of using OnTriggerStay rather than OnTriggerEnter? I understand that OnTriggerStay calls every frame, but if an event is being sent to another state either way, why would it matter?  ???
Its usefull because just after scene loaded you need a way to check if object A is inside trigger B. Doing this without OnTriggerStay would be very complicated actually.

Andrew.Lukasik

  • Full Member
  • ***
  • Posts: 134
    • my twitter @andrewlukasik
Re: OnTrigger Exit Problem
« Reply #2 on: January 05, 2012, 07:42:13 PM »
(...) Am I correct in believing that the TriggerExit function SHOULD execute after the ball has been hit into then out of a trigger? Or am I missing something here?
(...)
Yes. If it doesn't work then i suggest checking everything again. Sometimes it can one tiny flag set to wrong state, physic layers, etc