Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: PolyMad on September 04, 2021, 02:42:19 PM

Title: Again TRIGGER action problems [SOLVED][ALMOST]
Post by: PolyMad on September 04, 2021, 02:42:19 PM
In the image you can see 2 green boxes one inside the other and in another they are crossing.

However, the action always stops the flow completely and I don't really know what to do.

I tried TRIGGER ENTER and TRIGGER STAY, because it's a situation where the one of the boxes spawns inside the other, but it didn't work.

The tags are right and everything in the scene seems to be right to have this working.

P.S.: of course I also tried to disable the WAIT action that I added to slow down the system.
Title: Re: Trigger action does not seem to be working
Post by: PolyMad on September 04, 2021, 03:14:00 PM
Adding a RIGIDBODY to every box worked.
However I'm now wondering why this is needed: rigidbody is a physics feature that I really don't need for this system, and it has quite an overhead.
Title: Re: Trigger action does not seem to be working [SOLVED]
Post by: PolyMad on September 04, 2021, 05:42:12 PM
However, the action still didn't want to exit once the collision was negative.
I added a WAIT of 0.001 seconds and now it leaves the state.
Title: Re: Trigger action does not seem to be working [SOLVED]
Post by: PolyMad on September 04, 2021, 06:39:07 PM
Now, it kept blocking until I understood that I had to catch also the exception when the room was outside, so you can see it in the image.
And yet, when the second room is placed, it locks again at this state... and now I REALLY don't know what to do.

I even tried to add the third option, just in case, but nothing.
I can't understand how it's possible that it gets stuck in there.
It MUST be one of those 3 options, right? RIGHT?
Or... is Unity sending a 4th option that is not considered by the Playmaker action and thus the freezing?
Title: Re: Again TRIGGER action problems [SOLVED][ALMOST]
Post by: PolyMad on September 04, 2021, 06:58:36 PM
I activated the collider storing and in fact the room you see there is NOT colliding.
So why not proceeding with the goddammned FINISHED transition???
Title: Re: Again TRIGGER action problems [SOLVED][ALMOST]
Post by: PolyMad on September 04, 2021, 07:02:32 PM
Maybe I shouldn't, but I'm betting my ass that this freeze is due to Unity sending the event OUTSIDE, which is not contemplated in the Playmaker action...
Title: Re: Again TRIGGER action problems [SOLVED][ALMOST]
Post by: ch1ky3n on September 05, 2021, 02:06:05 PM
have you tried using global events instead?
It might not suit your need though.

Just duplicate ur game object and use right-click on FSM editor/Add Global Transition/System Events/Trigger enter, etc
Title: Re: Again TRIGGER action problems [SOLVED][ALMOST]
Post by: PolyMad on September 06, 2021, 08:00:26 AM
have you tried using global events instead?
It might not suit your need though.

Just duplicate ur game object and use right-click on FSM editor/Add Global Transition/System Events/Trigger enter, etc

Mmmmm thank you for help, but why should I use global stuff when all of this happens locally?
I am purposedly developing the whole thing in-place so to simplify it and because there is really no need to go global.
This is a trigger problem much much much likely, as seeing that it freezes at that state where triggers actions are involved.
Title: Re: Again TRIGGER action problems [SOLVED][ALMOST]
Post by: djaydino on September 06, 2021, 08:20:49 AM
Hi.
On Trigger Exit will not work if the collider component  has exited while the action is not active (aka a different state is active, then collider component exits, then state with trigger exit becomes active)

what i usually do for this is having a separate fsm with 2 states :
State 1 :
Set Bool value (false)
Trigger stay

State 2 :
Set Bool value (true)
Trigger Exit

Name the bool value 'In Trigger" for example

Then on the fsms where i need to look if enter/exit i use fsm bool test (every Frame if needed) targeting the trigger fsm.

you can find the action on the Ecosystem, but i added as attachment as well since at the moment the Ecosystem is not working.
Title: Re: Again TRIGGER action problems [SOLVED][ALMOST]
Post by: ch1ky3n on September 06, 2021, 08:58:59 AM
have you tried using global events instead?
It might not suit your need though.

Just duplicate ur game object and use right-click on FSM editor/Add Global Transition/System Events/Trigger enter, etc

Mmmmm thank you for help, but why should I use global stuff when all of this happens locally?
I am purposedly developing the whole thing in-place so to simplify it and because there is really no need to go global.
This is a trigger problem much much much likely, as seeing that it freezes at that state where triggers actions are involved.

Using Global events is not what you think it is (The evil sin of anything Global)
basically, it is the same thing as using a normal state where you add a trigger event and drag the node to the next state.
except it is built-in into the playmaker. similar to UI clicks, etc in global event/UI
I think it is more like listeners rather than a global event , I dunno why they put it under global event though  ;D


Title: Re: Again TRIGGER action problems [SOLVED][ALMOST]
Post by: PolyMad on September 06, 2021, 10:51:29 AM
have you tried using global events instead?
It might not suit your need though.

Just duplicate ur game object and use right-click on FSM editor/Add Global Transition/System Events/Trigger enter, etc

Mmmmm thank you for help, but why should I use global stuff when all of this happens locally?
I am purposedly developing the whole thing in-place so to simplify it and because there is really no need to go global.
This is a trigger problem much much much likely, as seeing that it freezes at that state where triggers actions are involved.

Using Global events is not what you think it is (The evil sin of anything Global)
basically, it is the same thing as using a normal state where you add a trigger event and drag the node to the next state.
except it is built-in into the playmaker. similar to UI clicks, etc in global event/UI
I think it is more like listeners rather than a global event , I dunno why they put it under global event though  ;D

I had a bad experience a while ago, where renaming global variables mangled the whole Playmaker db... and I'm not the only one... so I'm staying as far as possible from them until this is sorted out.
Title: Re: Again TRIGGER action problems [SOLVED][ALMOST]
Post by: djaydino on September 06, 2021, 03:43:19 PM
Hi.
As ch1ky3n said Global Events/Transitions  is something different than Global Variables.

Global Events/Transitions is something very useful and i have been using that a lot without issues.


Title: Re: Again TRIGGER action problems [SOLVED][ALMOST]
Post by: PolyMad on September 06, 2021, 05:36:24 PM
On Trigger Exit will not work if the collider component  has exited while the action is not active (aka a different state is active, then collider component exits, then state with trigger exit becomes active)

AHA! That's the problem! Thank you!
Title: Re: Again TRIGGER action problems [SOLVED][ALMOST]
Post by: PolyMad on September 06, 2021, 05:37:24 PM
Hi.
As ch1ky3n said Global Events/Transitions  is something different than Global Variables.

Global Events/Transitions is something very useful and i have been using that a lot without issues.


Ah yes yes, I misunderstood!