playMaker

Author Topic: Again TRIGGER action problems [SOLVED][ALMOST]  (Read 1194 times)

PolyMad

  • Hero Member
  • *****
  • Posts: 545
Again TRIGGER action problems [SOLVED][ALMOST]
« 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.
« Last Edit: September 04, 2021, 06:39:39 PM by PolyMad »

PolyMad

  • Hero Member
  • *****
  • Posts: 545
Re: Trigger action does not seem to be working
« Reply #1 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.

PolyMad

  • Hero Member
  • *****
  • Posts: 545
Re: Trigger action does not seem to be working [SOLVED]
« Reply #2 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.

PolyMad

  • Hero Member
  • *****
  • Posts: 545
Re: Trigger action does not seem to be working [SOLVED]
« Reply #3 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?
« Last Edit: September 04, 2021, 06:55:50 PM by PolyMad »

PolyMad

  • Hero Member
  • *****
  • Posts: 545
Re: Again TRIGGER action problems [SOLVED][ALMOST]
« Reply #4 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???

PolyMad

  • Hero Member
  • *****
  • Posts: 545
Re: Again TRIGGER action problems [SOLVED][ALMOST]
« Reply #5 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...

ch1ky3n

  • Full Member
  • ***
  • Posts: 208
Re: Again TRIGGER action problems [SOLVED][ALMOST]
« Reply #6 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

PolyMad

  • Hero Member
  • *****
  • Posts: 545
Re: Again TRIGGER action problems [SOLVED][ALMOST]
« Reply #7 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.

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7614
    • jinxtergames
Re: Again TRIGGER action problems [SOLVED][ALMOST]
« Reply #8 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.

ch1ky3n

  • Full Member
  • ***
  • Posts: 208
Re: Again TRIGGER action problems [SOLVED][ALMOST]
« Reply #9 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



PolyMad

  • Hero Member
  • *****
  • Posts: 545
Re: Again TRIGGER action problems [SOLVED][ALMOST]
« Reply #10 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.

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7614
    • jinxtergames
Re: Again TRIGGER action problems [SOLVED][ALMOST]
« Reply #11 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.



PolyMad

  • Hero Member
  • *****
  • Posts: 545
Re: Again TRIGGER action problems [SOLVED][ALMOST]
« Reply #12 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!

PolyMad

  • Hero Member
  • *****
  • Posts: 545
Re: Again TRIGGER action problems [SOLVED][ALMOST]
« Reply #13 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!