Playmaker Forum

Bug Reporting => PlayMaker Bug Reporting => Topic started by: xsodus on March 22, 2012, 03:10:00 AM

Title: [SOLVED] Error occur when Send Event to Game Object FSM after reload level
Post by: xsodus on March 22, 2012, 03:10:00 AM
@Playmaker Team
I am a newbie in Unity and Playmaker.
I use Playmaker V1.3.2 (updated from Playmaker V1.2.1)
I got a same problem as marcos (http://hutonggames.com/playmakerforum/index.php?topic=1124.0 (http://hutonggames.com/playmakerforum/index.php?topic=1124.0))
but it happened on some game object.

I noticed that when game object executed the Sent Event action, it will display error.
In addition , it will occur on same game object everytime that I reload scene.


Example Log
Error Log 1
Code: [Select]
MissingReferenceException: The object of type 'PlayMakerFSM' has been destroyed but you are still trying to access it.
Your script should either check if it is null or you should not destroy the object.
HutongGames.PlayMaker.Fsm.SendEventToFsmOnGameObject (UnityEngine.GameObject gameObject, System.String fsmName, HutongGames.PlayMaker.FsmEvent fsmEvent)
HutongGames.PlayMaker.Fsm.Event (HutongGames.PlayMaker.FsmEventTarget eventTarget, HutongGames.PlayMaker.FsmEvent fsmEvent)
HutongGames.PlayMaker.Actions.SendEvent.OnEnter () (at Assets/PlayMaker/Actions/SendEvent.cs:39)
HutongGames.PlayMaker.FsmState.OnEnter ()
HutongGames.PlayMaker.Fsm.EnterState (HutongGames.PlayMaker.FsmState state)
HutongGames.PlayMaker.Fsm.SwitchState (HutongGames.PlayMaker.FsmState toState)
HutongGames.PlayMaker.Fsm.DoTransition (HutongGames.PlayMaker.FsmTransition transition, Boolean isGlobal)
HutongGames.PlayMaker.Fsm.ChangeState (HutongGames.PlayMaker.FsmEvent fsmEvent)
HutongGames.PlayMaker.Fsm.Event (HutongGames.PlayMaker.FsmEventTarget eventTarget, HutongGames.PlayMaker.FsmEvent fsmEvent)
HutongGames.PlayMaker.Fsm.Event (HutongGames.PlayMaker.FsmEvent fsmEvent)
HutongGames.PlayMaker.Actions.PlayAnimation.OnUpdate () (at Assets/PlayMaker/Actions/PlayAnimation.cs:111)
HutongGames.PlayMaker.FsmState.OnUpdate ()
HutongGames.PlayMaker.Fsm.UpdateState (HutongGames.PlayMaker.FsmState state)
HutongGames.PlayMaker.Fsm.Update ()
PlayMakerFSM.Update ()

Error Log 2
Code: [Select]
MissingReferenceException: The object of type 'PlayMakerFSM' has been destroyed but you are still trying to access it.
Your script should either check if it is null or you should not destroy the object.
HutongGames.PlayMaker.Fsm.SendEventToFsmOnGameObject (UnityEngine.GameObject gameObject, System.String fsmName, HutongGames.PlayMaker.FsmEvent fsmEvent)
HutongGames.PlayMaker.Fsm.Event (HutongGames.PlayMaker.FsmEventTarget eventTarget, HutongGames.PlayMaker.FsmEvent fsmEvent)
HutongGames.PlayMaker.Actions.SendEvent.OnEnter () (at Assets/PlayMaker/Actions/SendEvent.cs:39)
HutongGames.PlayMaker.FsmState.OnEnter ()
HutongGames.PlayMaker.Fsm.EnterState (HutongGames.PlayMaker.FsmState state)
HutongGames.PlayMaker.Fsm.SwitchState (HutongGames.PlayMaker.FsmState toState)
HutongGames.PlayMaker.Fsm.DoTransition (HutongGames.PlayMaker.FsmTransition transition, Boolean isGlobal)
HutongGames.PlayMaker.Fsm.ChangeState (HutongGames.PlayMaker.FsmEvent fsmEvent)
HutongGames.PlayMaker.Fsm.Event (HutongGames.PlayMaker.FsmEventTarget eventTarget, HutongGames.PlayMaker.FsmEvent fsmEvent)
HutongGames.PlayMaker.Fsm.Event (HutongGames.PlayMaker.FsmEvent fsmEvent)
HutongGames.PlayMaker.FsmState.CheckFinished ()
HutongGames.PlayMaker.FsmState.OnEnter ()
HutongGames.PlayMaker.Fsm.EnterState (HutongGames.PlayMaker.FsmState state)
HutongGames.PlayMaker.Fsm.SwitchState (HutongGames.PlayMaker.FsmState toState)
HutongGames.PlayMaker.Fsm.DoTransition (HutongGames.PlayMaker.FsmTransition transition, Boolean isGlobal)
HutongGames.PlayMaker.Fsm.ChangeState (HutongGames.PlayMaker.FsmEvent fsmEvent)
HutongGames.PlayMaker.Fsm.Event (HutongGames.PlayMaker.FsmEventTarget eventTarget, HutongGames.PlayMaker.FsmEvent fsmEvent)
HutongGames.PlayMaker.Fsm.Event (HutongGames.PlayMaker.FsmEvent fsmEvent)
HutongGames.PlayMaker.FsmState.CheckFinished ()
HutongGames.PlayMaker.FsmState.OnEnter ()
HutongGames.PlayMaker.Fsm.EnterState (HutongGames.PlayMaker.FsmState state)
HutongGames.PlayMaker.Fsm.SwitchState (HutongGames.PlayMaker.FsmState toState)
HutongGames.PlayMaker.Fsm.DoTransition (HutongGames.PlayMaker.FsmTransition transition, Boolean isGlobal)
HutongGames.PlayMaker.Fsm.ChangeState (HutongGames.PlayMaker.FsmEvent fsmEvent)
HutongGames.PlayMaker.Fsm.Event (HutongGames.PlayMaker.FsmEventTarget eventTarget, HutongGames.PlayMaker.FsmEvent fsmEvent)
HutongGames.PlayMaker.Fsm.Event (HutongGames.PlayMaker.FsmEvent fsmEvent)
HutongGames.PlayMaker.FsmState.CheckFinished ()
HutongGames.PlayMaker.FsmState.OnEnter ()
HutongGames.PlayMaker.Fsm.EnterState (HutongGames.PlayMaker.FsmState state)
HutongGames.PlayMaker.Fsm.SwitchState (HutongGames.PlayMaker.FsmState toState)
HutongGames.PlayMaker.Fsm.DoTransition (HutongGames.PlayMaker.FsmTransition transition, Boolean isGlobal)
HutongGames.PlayMaker.Fsm.ChangeState (HutongGames.PlayMaker.FsmEvent fsmEvent)
HutongGames.PlayMaker.Fsm.Event (HutongGames.PlayMaker.FsmEventTarget eventTarget, HutongGames.PlayMaker.FsmEvent fsmEvent)
HutongGames.PlayMaker.Fsm.Event (HutongGames.PlayMaker.FsmEvent fsmEvent)
HutongGames.PlayMaker.Actions.Wait.OnUpdate () (at Assets/PlayMaker/Actions/Wait.cs:53)
HutongGames.PlayMaker.FsmState.OnUpdate ()
HutongGames.PlayMaker.Fsm.UpdateState (HutongGames.PlayMaker.FsmState state)
HutongGames.PlayMaker.Fsm.Update ()
PlayMakerFSM.Update ()






Example FSM

(http://image.free.in.th/z/ix/reload_pro.png)

How can I fix this problem? Please tell me.

Thanks.

 
Title: Re: Error occur when Send Event to Game Object FSM after reload level
Post by: jeanfabre on March 22, 2012, 08:13:31 AM
Hi,

 I have the same problem, and the current beta version seems to have fixed it.

The way to go around it is to not send events from a state that originates from the START event. you can use various technics to break the flow, but it really depends on why you are sending en event when starting. Maybe you can wait some triggers in your application, or implement a delayed event, or even try next frame Event action. Or maybe try to find a way to build your app so that it doesn't need this event being sent at Start.

Hopefully that will give you some hints to fix this.


Bye,

 Jean
Title: Re: Error occur when Send Event to Game Object FSM after reload level
Post by: xsodus on March 22, 2012, 11:05:59 AM
Thank you jeanfabre. I'll try to fix it.
Title: Re: Error occur when Send Event to Game Object FSM after reload level
Post by: Alex Chouls on March 22, 2012, 11:11:18 AM
@xsodus: I just sent you a PM about joining the beta to check that it fixes this bug...
Title: Re: Error occur when Send Event to Game Object FSM after reload level
Post by: xsodus on March 22, 2012, 10:49:50 PM
@Alex Chouls I already replied to you. Please check PM.

Thank you.
xsodus
Title: Re: Error occur when Send Event to Game Object FSM after reload level
Post by: xsodus on March 23, 2012, 12:35:52 AM
@Alex Chouls
what should i do next?
Should I update to Playmaker 1.3.3 RC2 or send an error by using current version (Playmaker V1.3.2). 
Title: Re: Error occur when Send Event to Game Object FSM after reload level
Post by: Alex Chouls on March 23, 2012, 01:27:31 AM
Backup your project, and update to 1.3.3 RC2. If you still get the error, submit a bug report from the beta...
Title: Re: Error occur when Send Event to Game Object FSM after reload level
Post by: xsodus on March 23, 2012, 07:15:21 AM
@Alex Chouls
I'll try to use 1.3.3 RC2.
It's work. :D
Now , I don't get this error anymore.
If I found something wrong , I'll complain to you again.

Thank you very much   ;)
xsodus.