Playmaker Forum
PlayMaker Help & Tips => PlayMaker Help => Topic started by: Boxman on October 23, 2011, 04:38:29 AM
-
Hey Guys,
When I try to broadcast an event to every FSM in the level I'm finding i get errors that kill performance.
Here is what unity outputs:
"NullReferenceException: Object reference not set to an instance of an object
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 (System.String eventName)
HutongGames.PlayMaker.Fsm.Event (System.String fsmEventName)
HutongGames.PlayMaker.Actions.BroadcastEvent.BroadcastToAll () (at Assets/PlayMaker/Actions/BroadcastEvent.cs:60)"
And when i double click the error it highlights this line of code:
fsm.Event(broadcastEvent.Value);
Are there any issues with broadcasting events i should be aware of?
Is there a better way of destroying all instances of an object at once?
-
Try using the new BroadcastAll target in the Send Event action (v1.2).
As of 1.2 the Broadcast Event action is obsolete...
-
Ah ok, cool, thanks.
I thought i was up to date with the latest version but looks like I wasn't