Playmaker Forum
PlayMaker Help & Tips => PlayMaker Help => Topic started by: MlleBun on March 04, 2021, 02:51:45 PM
-
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!
-
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.
-
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.