playMaker

Author Topic: [Playmaker 1.9.1.p3] No event is sent on an OnTriggerEnter action  (Read 161 times)

MlleBun

  • Playmaker Newbie
  • *
  • Posts: 25
    • View Profile
Hi,

I could use some help understanding why my OnTriggerEnter state is not validated when the player enters the triggerzone yet. What's weird is that I previously used this same structure on a previous project and it worked perfectly then. The only difference is that I downloaded the Cinemachine addon from Ecosystem and I'm using the GetPriority action in the FMS instead of a basi SetProperty action.

Player
  • Has a Capsule collider where isTrigger is false
  • Has a Rigidbody where UseGravity is false and isKinematic is true

Triggerzone
  • Has a Box collider where isTrigger is set to true
  • Has a Rigidbody where UseGravity is false and isKinematic is true


Attachement
PM_Trigger5 - The state where the FSM gets stuck even if the player has entered the triggerzone.


I also tried onTriggerStay, but it's the same.

Thanks for any help!
« Last Edit: March 04, 2021, 02:53:49 PM by MlleBun »

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 3893
  • Official Playmaker Support
    • View Profile
    • LinkedIn
Re: [Playmaker 1.9.1.p3] No event is sent on an OnTriggerEnter action
« Reply #1 on: March 07, 2021, 01:11:47 AM »
It's hard to say what's wrong from the screenshots.

You could try using Physics Debug Visualization: https://docs.unity3d.com/Manual/PhysicsDebugVisualization.html

To double check that all the triggers/colliders/rigidbodies are setup properly.

You could also try making the simpler TriggerOnEnter/TriggerOnExit loop in this scene to check that works before adding states.

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 6003
    • View Profile
    • jinxtergames
Re: [Playmaker 1.9.1.p3] No event is sent on an OnTriggerEnter action
« Reply #2 on: March 08, 2021, 06:13:44 AM »
Hi.
I always use a separate fsm with 2 states (trigger stay and trigger exit)
and set a bool (in Trigger)

Then i use 'Fsm Bool Test' ([url = https://hutonggames.fogbugz.com/default.asp?W1181]Ecosystem[/url]) on other fsms to do its logic especially if there is some delay between those state (for example a wait, some tweens, etc.)

The main reason is because if the trigger is exited before the trigger exit state is active, it will not trigger as a trigger exit anymore.
But its also easier to debug.

double check layers also (project settings)
Also make sure you need 2d or 3d as the use different trigger event actions.