Playmaker Forum
PlayMaker Help & Tips => PlayMaker Help => Topic started by: fantome2024 on November 03, 2015, 09:05:07 PM
-
Hello, I'm brand new to Playmaker and trying to figure out connecting a switch to lights. Here is what I'm trying to do.
On "Mouse pick event" flip lights "On"
On "Mouse pick event" flip lights "Off"
but when I click the switch I receive the error below
Switch : FSM : Loop count exceeded maximum: 1000 Default is 1000. Override in Fsm Inspector.
UnityEngine.Debug:LogError(Object)
HutongGames.PlayMaker.FsmLog:AddEntry(FsmLogEntry)
HutongGames.PlayMaker.FsmLog:Log(FsmLogType, String)
HutongGames.PlayMaker.FsmLog:LogError(String)
HutongGames.PlayMaker.Fsm:EnterState(FsmState)
HutongGames.PlayMaker.Fsm:SwitchState(FsmState)
HutongGames.PlayMaker.Fsm:UpdateStateChanges()
HutongGames.PlayMaker.Fsm:UpdateState(FsmState)
Here is the pic of what I've done
-
Is it the same if you use mouse up instead of mouse down?
-
Correct same thing happens. I set both events to "mouse up" and it happened again.
-
Hi,
you can try to add 2x a state with a "mouse pick event" with a "mouse up" and "mouse off" on it. and place those in between
-
Hi,
you can try to add 2x a state with a "mouse pick event" with a "mouse up" and "mouse off" on it. and place those in between
Wouldn't that make it if I moved off the object the light would turn off? I want to be able to click On/Off like an actual light switch. If I'm mistaken could you elaborate a little more on how to setup. Like a drawing or pic. Thank you
-
Hi!
You can add a new state between those two with the action Wait 0.1 sec. it happened to me also
-
Hi,
an easier way is to add a state with a "next frame" action between your actions
-
I think you need a delay between the two states. therefor I normally add a wait action with 0.1 sec.
-
You are right! It worked with Next Frame Action! :)
-
It just happens that the next state is reached inside the same frame and the conditions are still true so it again goes to the next state... where the conditions are still true...
Ends up looping too much and throws the flag. Next Frame Event fixes this most of the time, but you could also fix it by using Get Mouse Button Down and Get Mouse Button Up which behave differently.
-
It just happens that the next state is reached inside the same frame and the conditions are still true so it again goes to the next state... where the conditions are still true...
Ends up looping too much and throws the flag. Next Frame Event fixes this most of the time, but you could also fix it by using Get Mouse Button Down and Get Mouse Button Up which behave differently.
Sorry I'm really new to this. Could you draw something or give me a visual of how to should be setup
-
Hi,
Here you go :)