playMaker

Author Topic: Another IndexOutOfRangeException when loading prefab with FSM  (Read 797 times)

diccon

  • Playmaker Newbie
  • *
  • Posts: 10
Another IndexOutOfRangeException when loading prefab with FSM
« on: October 07, 2022, 08:43:00 PM »
Similar to the previously posted bug, I'm making a new thread as it looks like our callstack is slightly different.  We always get around 20 of these on startup and I don't think we are seeing any incorrect behaviour, but I would like to clean up the errors before upgrading to 1.9 in case there is some deeper problem.

This is a the callstack
Code: [Select]
Error Loading Action: restart : HutongGames.PlayMaker.Actions.CollisionEvent : gameObject
System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
  at System.Collections.Generic.List`1[T].get_Item (System.Int32 index) [0x00009] in <6073cf49ed704e958b8a66d540dea948>:0
  at HutongGames.PlayMaker.ActionData.GetFsmOwnerDefault (HutongGames.PlayMaker.Fsm fsm, System.Int32 paramIndex) [0x00000] in C:\Projects\Playmaker_1.9.0\Projects\Playmaker.source.unity\Assets\PlayMaker\Classes\ActionData.cs:1984
  at HutongGames.PlayMaker.ActionData.LoadActionField (HutongGames.PlayMaker.Fsm fsm, System.Object obj, System.Reflection.FieldInfo field, System.Int32 paramIndex) [0x002cd] in C:\Projects\Playmaker_1.9.0\Projects\Playmaker.source.unity\Assets\PlayMaker\Classes\ActionData.cs:1087
  at HutongGames.PlayMaker.ActionData.CreateAction (HutongGames.PlayMaker.ActionData+Context context, System.Int32 actionIndex) [0x0024f] in C:\Projects\Playmaker_1.9.0\Projects\Playmaker.source.unity\Assets\PlayMaker\Classes\ActionData.cs:942
UnityEngine.Debug:LogError (object)
HutongGames.PlayMaker.ActionData:CreateAction (HutongGames.PlayMaker.ActionData/Context,int) (at C:/Projects/Playmaker_1.9.0/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/ActionData.cs:947)
HutongGames.PlayMaker.ActionData:LoadActions (HutongGames.PlayMaker.FsmState) (at C:/Projects/Playmaker_1.9.0/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/ActionData.cs:776)
HutongGames.PlayMaker.FsmState:LoadActions () (at C:/Projects/Playmaker_1.9.0/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/FsmState.cs:123)
HutongGames.PlayMaker.Fsm:InitData () (at C:/Projects/Playmaker_1.9.0/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/Fsm.cs:1746)
PlayMakerFSM:OnAfterDeserialize () (at C:/Projects/Playmaker_1.9.0/Projects/Playmaker.source.unity/Assets/PlayMaker/PlayMakerFSM.cs:903)
UnityEngine.Object:Instantiate<UnityEngine.GameObject> (UnityEngine.GameObject)


Unfortunately I can't set a breakpoint to see which fsm or state is going wrong, if I could even get that information I might be able to clean it up.

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7615
    • jinxtergames
Re: Another IndexOutOfRangeException when loading prefab with FSM
« Reply #1 on: October 12, 2022, 02:46:41 AM »
Hi.
The action "restart" is this a custom action from the ecosystem or from a 3rd party asset?

diccon

  • Playmaker Newbie
  • *
  • Posts: 10
Re: Another IndexOutOfRangeException when loading prefab with FSM
« Reply #2 on: October 14, 2022, 01:48:29 AM »
i think restart is the name of the state, and the action is after that, for example we also get these others:

Code: [Select]
Error Loading Action: restart : HutongGames.PlayMaker.Actions.FloatCompare : equal
System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Error Loading Action: restart : HutongGames.PlayMaker.Actions.FloatCompare : lessThan
System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Error Loading Action: restart : HutongGames.PlayMaker.Actions.SendEvent : everyFrame
System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.

Unfortunately we have many nested prefabs so I can't find the restart state to try and figure out what is wrong with it, is there a way to find a state by name? Or if the error handler could print the name of the fsm that would also be really helpful.