Playmaker Forum
PlayMaker Help & Tips => PlayMaker Help => Topic started by: autumnboy on October 08, 2018, 11:38:10 PM
-
Hi all,
I'm using Pool Manager 5 and Playmaker 1.9.0.p4
When I go to despawn a pooled item I get this error pop up:
SpawnPool Enemy_Bullets: Explosion(Clone)001 has already been despawned. You cannot despawn something more than once!
UnityEngine.Debug:LogError(Object)
SpawnPool Enemy_Bullets:Explosion(Clone)001 has already been despawned. You cannot despawn something more than once!
UnityEngine.Debug:LogError(Object)
PathologicalGames.SpawnPool:Despawn(Transform) (at Assets/Plugins/PathologicalGames/PoolManager/SpawnPool.cs:841)
HutongGames.PlayMaker.Actions.PmtDeSpawn:DoDeSpawn() (at Assets/PlayMaker Custom Actions/PathologicalGames/PoolManager/PmtDeSpawn.cs:79)
HutongGames.PlayMaker.Actions.PmtDeSpawn:OnEnter() (at Assets/PlayMaker Custom Actions/PathologicalGames/PoolManager/PmtDeSpawn.cs:44)
HutongGames.PlayMaker.FsmState:ActivateActions(Int32) (at C:/Projects/Playmaker_1.9.0/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/FsmState.cs:205)
HutongGames.PlayMaker.FsmState:OnEnter() (at C:/Projects/Playmaker_1.9.0/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/FsmState.cs:175)
HutongGames.PlayMaker.Fsm:EnterState(FsmState) (at C:/Projects/Playmaker_1.9.0/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/Fsm.cs:2767)
HutongGames.PlayMaker.Fsm:SwitchState(FsmState) (at C:/Projects/Playmaker_1.9.0/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/Fsm.cs:2714)
HutongGames.PlayMaker.Fsm:UpdateStateChanges() (at C:/Projects/Playmaker_1.9.0/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/Fsm.cs:2642)
HutongGames.PlayMaker.Fsm:Start() (at C:/Projects/Playmaker_1.9.0/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/Fsm.cs:1925)
HutongGames.PlayMaker.Fsm:ProcessEvent(FsmEvent, FsmEventData) (at C:/Projects/Playmaker_1.9.0/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/Fsm.cs:2212)
HutongGames.PlayMaker.Fsm:Event(FsmEventTarget, FsmEvent) (at C:/Projects/Playmaker_1.9.0/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/Fsm.cs:2375)
HutongGames.PlayMaker.Fsm:Event(FsmEvent) (at C:/Projects/Playmaker_1.9.0/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/Fsm.cs:2456)
PlayMakerFSM:OnDisable() (at C:/Projects/Playmaker_1.9.0/Projects/Playmaker.source.unity/Assets/PlayMaker/PlayMakerFSM.cs:631)
UnityEngine.GameObject:SetActive(Boolean)
PathologicalGames.PrefabPool:DespawnInstance(Transform, Boolean) (at Assets/Plugins/PathologicalGames/PoolManager/SpawnPool.cs:1483)
PathologicalGames.PrefabPool:PreloadInstances() (at Assets/Plugins/PathologicalGames/PoolManager/SpawnPool.cs:1864)
PathologicalGames.SpawnPool:CreatePrefabPool(PrefabPool) (at Assets/Plugins/PathologicalGames/PoolManager/SpawnPool.cs:374)
PathologicalGames.SpawnPool:Spawn(Transform, Vector3, Quaternion, Transform) (at Assets/Plugins/PathologicalGames/PoolManager/SpawnPool.cs:565)
PathologicalGames.SpawnPool:Spawn(Transform, Vector3, Quaternion) (at Assets/Plugins/PathologicalGames/PoolManager/SpawnPool.cs:601)
HutongGames.PlayMaker.Actions.PmtSpawn:DoSpawn() (at Assets/PlayMaker Custom Actions/PathologicalGames/PoolManager/PmtSpawn.cs:86)
HutongGames.PlayMaker.Actions.PmtSpawn:OnEnter() (at Assets/PlayMaker Custom Actions/PathologicalGames/PoolManager/PmtSpawn.cs:55)
HutongGames.PlayMaker.FsmState:ActivateActions(Int32) (at C:/Projects/Playmaker_1.9.0/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/FsmState.cs:205)
HutongGames.PlayMaker.FsmState:OnEnter() (at C:/Projects/Playmaker_1.9.0/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/FsmState.cs:175)
HutongGames.PlayMaker.Fsm:EnterState(FsmState) (at C:/Projects/Playmaker_1.9.0/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/Fsm.cs:2767)
HutongGames.PlayMaker.Fsm:SwitchState(FsmState) (at C:/Projects/Playmaker_1.9.0/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/Fsm.cs:2714)
HutongGames.PlayMaker.Fsm:UpdateStateChanges() (at C:/Projects/Playmaker_1.9.0/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/Fsm.cs:2642)
HutongGames.PlayMaker.Fsm:DoTransition(FsmTransition, Boolean) (at C:/Projects/Playmaker_1.9.0/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/Fsm.cs:2681)
HutongGames.PlayMaker.Fsm:ProcessEvent(FsmEvent, FsmEventData) (at C:/Projects/Playmaker_1.9.0/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/Fsm.cs:2252)
HutongGames.PlayMaker.Fsm:SendEventToFsmOnGameObject(GameObject, String, FsmEvent) (at C:/Projects/Playmaker_1.9.0/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/Fsm.cs:2621)
HutongGames.PlayMaker.Fsm:Event(FsmEventTarget, FsmEvent) (at C:/Projects/Playmaker_1.9.0/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/Fsm.cs:2388)
HutongGames.PlayMaker.Actions.SendEvent:OnEnter() (at Assets/PlayMaker/Actions/SendEvent.cs:42)
HutongGames.PlayMaker.FsmState:ActivateActions(Int32) (at C:/Projects/Playmaker_1.9.0/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/FsmState.cs:205)
HutongGames.PlayMaker.FsmState:OnEnter() (at C:/Projects/Playmaker_1.9.0/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/FsmState.cs:175)
HutongGames.PlayMaker.Fsm:EnterState(FsmState) (at C:/Projects/Playmaker_1.9.0/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/Fsm.cs:2767)
HutongGames.PlayMaker.Fsm:SwitchState(FsmState) (at C:/Projects/Playmaker_1.9.0/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/Fsm.cs:2714)
HutongGames.PlayMaker.Fsm:UpdateStateChanges() (at C:/Projects/Playmaker_1.9.0/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/Fsm.cs:2642)
HutongGames.PlayMaker.Fsm:OnTriggerEnter(Collider) (at C:/Projects/Playmaker_1.9.0/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/Fsm.cs:3118)
PlayMakerTriggerEnter:OnTriggerEnter(Collider) (at C:/Projects/Playmaker_1.9.0/Projects/Playmaker.source.unity/Assets/PlayMaker/PlayMakerTriggerEnter.cs:21)
Anyone else had this problem? It worked fine before. I'm only calling the despawn action once and it can only be called when the object is active/been spawned.
Thanks,
Josh
-
Hi,
this is likely an error in your logic, since you can't despawn twice as the error message says.
so I would double check your logic, somewhere, you have an action that despawn it one too many time.
If the problem persist, can you test on an empty scene with a barebone repro, if you can isolate the issue, then I can have a look.
Bye,
Jean
-
Okay,
Thanks
Jean
Cheers
-
Hi @autumnboy, did you ever resolve this issue? I am having the exact same error. I have built this as a barebones scene to isolate the error.
I am pooling a single object. It has an FSM with a single Translate action on it to move it across the ground plane.
At the far end of the ground plane is a box collider with the FSM "DeSpawnBounds". The structure of that FSM is attached.
-
Okay, so I added a Next Frame Event as the final action of the "de-spawn" state and now it works.
I don't understand the logic of the de-spawn action well enough to know why this makes a difference or if the Next Frame Event is the appropriate solution.
-
Hi,
yes, next frame event is likely your best option here. It leaves time to all fsm to properly process before that.
Bye,
Jean