playMaker

Author Topic: FINISHED doesnt trigger after SetMaterial Action [SOLVED]  (Read 898 times)

krearthur

  • Playmaker Newbie
  • *
  • Posts: 5
FINISHED doesnt trigger after SetMaterial Action [SOLVED]
« on: June 28, 2021, 03:36:12 AM »
Hi,
I just installed PlayMaker and watched some tutorials.
I set up a very simple FSM, that just sets the material with the SetMaterial action and then with the FINISHED transition go to a new state that does a random wait.
See Attachment for screenshot of FSM.

I'm using Unity 2019.4.25 (LTS) and Playmaker 1.9.2.f3

I also added an extra RandomWait in the first state for testing, and it gets executed. I see the progress bar of the action. But when it finishes, nothing happens.

Am I missing something?

thanks in advance:)
« Last Edit: July 06, 2021, 06:42:25 AM by krearthur »

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: FINISHED doesnt trigger after SetMaterial Action
« Reply #1 on: June 28, 2021, 06:47:19 AM »
Hi.
I check the material action, it should be fine.

Can you show the wait random, maybe its just doing wait random and back to 'open' and never goes to 'close'

krearthur

  • Playmaker Newbie
  • *
  • Posts: 5
Re: FINISHED doesnt trigger after SetMaterial Action
« Reply #2 on: July 06, 2021, 04:55:16 AM »
Hi, sorry for the late reply, I was on holidays.
Here is the screenshot of the WaitRandom State.

thanks for looking into it.

krearthur

  • Playmaker Newbie
  • *
  • Posts: 5
Re: FINISHED doesnt trigger after SetMaterial Action
« Reply #3 on: July 06, 2021, 05:14:12 AM »
I also turned on debugging to see which states are transitioned how many times.
In the screenshot of the FSM in play mode you can see that the EyesOpen State is active, and that it never transitioned to the RandomWait state.

Note: I forgot to set the bool value of "EyesOpen" variable to true after SetMaterial in the EyesOpen state, but that also didn't fix the behaviour..

I also upgraded to Unity 2021.1.12 but that didn't change anything.

Is there some global setting or something to enable Playmaker or so? Or is every state machine automatically active and executed on every active game object in the scene? Maybe I forgot something very basic..

krearthur

  • Playmaker Newbie
  • *
  • Posts: 5
Re: FINISHED doesnt trigger after SetMaterial Action
« Reply #4 on: July 06, 2021, 06:40:18 AM »
I found the problem! It was because I enabled  in Project Settings -> Editor -> Enter Play Mode Settings for faster playmode starting.

When using PlayMaker you have to also check the "Reload Scene" setting, or else the FSM's won't re-initialize when entering playmode.

now it works :)
(Maybe this could be stated somewhere in the docs, or even be addressed in a future update of Playmaker ;) )

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: FINISHED doesnt trigger after SetMaterial Action [SOLVED]
« Reply #5 on: July 06, 2021, 06:48:20 AM »
Hi.
Thanks for sharing your solution.


But your Wait Random will not work as the bool test will trigger as well

you can set the state in sequence (right click on empty space in the state window)

or use a separate state for wait.

krearthur

  • Playmaker Newbie
  • *
  • Posts: 5
Re: FINISHED doesnt trigger after SetMaterial Action [SOLVED]
« Reply #6 on: July 06, 2021, 07:07:16 AM »
yeah it didn't work that way^^ I changed to the following and it works fine :)