playMaker

Author Topic: Strange error that I don't understand  (Read 2263 times)

o4401

  • Playmaker Newbie
  • *
  • Posts: 10
Strange error that I don't understand
« on: January 13, 2020, 12:23:28 PM »
Hi All,

I'm new to Playmaker so it is possible that this error is caused by a logic in the Playmaker actions that I don't understand yet. It also might be a bug, but if it's not please try to explain what causes it.

I have 2 simple FSM's on a UI Image.
FSM 1:
Start -> UI On Pointer Down Event (FINISHED) -> Empty (FINISHED)
(The state called Empty has nothing in it and it is looped back to the UI On Pointer Down Event)

FSM 2:
Start -> UI On Pointer Up Event (FINISHED) -> Wait (FINISHED)
(The state called Wait contains a Wait action with Time: 1, and Finish Event: FINISHED)

When I press the gameobject, on the POINTER UP event, it shows an error:

Quote
ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
System.ThrowHelper.ThrowArgumentOutOfRangeException (System.ExceptionArgument argument, System.ExceptionResource resource) (at <437ba245d8404784b9fbab9b439ac908>:0)
System.ThrowHelper.ThrowArgumentOutOfRangeException () (at <437ba245d8404784b9fbab9b439ac908>:0)
System.Collections.Generic.List`1[T].get_Item (System.Int32 index) (at <437ba245d8404784b9fbab9b439ac908>:0)
UnityEngine.EventSystems.EventTrigger.Execute (UnityEngine.EventSystems.EventTriggerType id, UnityEngine.EventSystems.BaseEventData eventData) (at C:/Program Files/Unity Editor/2019.3.0f3/Editor/Data/Resources/PackageManager/BuiltInPackages/com.unity.ugui/Runtime/EventSystem/EventTrigger.cs:212)
UnityEngine.EventSystems.EventTrigger.OnPointerUp (UnityEngine.EventSystems.PointerEventData eventData) (at C:/Program Files/Unity Editor/2019.3.0f3/Editor/Data/Resources/PackageManager/BuiltInPackages/com.unity.ugui/Runtime/EventSystem/EventTrigger.cs:263)
UnityEngine.EventSystems.ExecuteEvents.Execute (UnityEngine.EventSystems.IPointerUpHandler handler, UnityEngine.EventSystems.BaseEventData eventData) (at C:/Program Files/Unity Editor/2019.3.0f3/Editor/Data/Resources/PackageManager/BuiltInPackages/com.unity.ugui/Runtime/EventSystem/ExecuteEvents.cs:43)
UnityEngine.EventSystems.ExecuteEvents.Execute[T] (UnityEngine.GameObject target, UnityEngine.EventSystems.BaseEventData eventData, UnityEngine.EventSystems.ExecuteEvents+EventFunction`1[T1] functor) (at C:/Program Files/Unity Editor/2019.3.0f3/Editor/Data/Resources/PackageManager/BuiltInPackages/com.unity.ugui/Runtime/EventSystem/ExecuteEvents.cs:261)
UnityEngine.EventSystems.EventSystem:Update() (at C:/Program Files/Unity Editor/2019.3.0f3/Editor/Data/Resources/PackageManager/BuiltInPackages/com.unity.ugui/Runtime/EventSystem/EventSystem.cs:377)

Here's what I have experienced so far:
 - If I turn off any one of the FSM's and leave only one, the remaining one works fine.
 - If I disable the Wait action in the Wait state, it works fine.
 - If I have empty states after both of the UI event listeners, but one of them is not looped back, then it also gives the same error.

Do you know what might cause this?

Thanks!

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Strange error that I don't understand
« Reply #1 on: January 14, 2020, 03:21:01 AM »
Hi,

Did you update Unity or playmaker before that error started?

Bye,

 Jean

o4401

  • Playmaker Newbie
  • *
  • Posts: 10
Re: Strange error that I don't understand
« Reply #2 on: January 14, 2020, 04:36:37 AM »
Hi Jean,

I created a clean project now with Unity 2019.2.17f1 and Playmaker 1.9.0.p19 and nothing else.

The error doesn't come up immediately in this project, but if I click the Image quickly 10 times or so, it gives the same error:

Quote
ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
System.ThrowHelper.ThrowArgumentOutOfRangeException (System.ExceptionArgument argument, System.ExceptionResource resource) (at <567df3e0919241ba98db88bec4c6696f>:0)
System.ThrowHelper.ThrowArgumentOutOfRangeException () (at <567df3e0919241ba98db88bec4c6696f>:0)
System.Collections.Generic.List`1[T].get_Item (System.Int32 index) (at <567df3e0919241ba98db88bec4c6696f>:0)
UnityEngine.EventSystems.EventTrigger.Execute (UnityEngine.EventSystems.EventTriggerType id, UnityEngine.EventSystems.BaseEventData eventData) (at C:/Program Files/Unity Editor/2019.2.17f1/Editor/Data/Resources/PackageManager/BuiltInPackages/com.unity.ugui/Runtime/EventSystem/EventTrigger.cs:212)
UnityEngine.EventSystems.EventTrigger.OnPointerDown (UnityEngine.EventSystems.PointerEventData eventData) (at C:/Program Files/Unity Editor/2019.2.17f1/Editor/Data/Resources/PackageManager/BuiltInPackages/com.unity.ugui/Runtime/EventSystem/EventTrigger.cs:255)
UnityEngine.EventSystems.ExecuteEvents.Execute (UnityEngine.EventSystems.IPointerDownHandler handler, UnityEngine.EventSystems.BaseEventData eventData) (at C:/Program Files/Unity Editor/2019.2.17f1/Editor/Data/Resources/PackageManager/BuiltInPackages/com.unity.ugui/Runtime/EventSystem/ExecuteEvents.cs:36)
UnityEngine.EventSystems.ExecuteEvents.Execute[T] (UnityEngine.GameObject target, UnityEngine.EventSystems.BaseEventData eventData, UnityEngine.EventSystems.ExecuteEvents+EventFunction`1[T1] functor) (at C:/Program Files/Unity Editor/2019.2.17f1/Editor/Data/Resources/PackageManager/BuiltInPackages/com.unity.ugui/Runtime/EventSystem/ExecuteEvents.cs:261)
UnityEngine.EventSystems.EventSystem:Update() (at C:/Program Files/Unity Editor/2019.2.17f1/Editor/Data/Resources/PackageManager/BuiltInPackages/com.unity.ugui/Runtime/EventSystem/EventSystem.cs:377)



jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Strange error that I don't understand
« Reply #3 on: January 14, 2020, 11:23:28 AM »
Hi,

 Can you try to launch from the menu: PlayMaker -> Tools -> Pre-process All Prefab FSMs. and also "Update all fsms in build"

 Let me know how it goes.

Bye,

 Jean

o4401

  • Playmaker Newbie
  • *
  • Posts: 10
Re: Strange error that I don't understand
« Reply #4 on: January 14, 2020, 12:31:06 PM »
Hi Jean,

When I press Playmaker>Tools>Preprocess all Prefab FSMs, Unity becomes unresponsive and I can't click on anything except for the top bar with File, Edit, Assets, etc buttons. I left it there for more than half an hour to see if it was just loading but nothing changed so I restarted Unity and re-opened the project.

Then I pressed "Update All FSMs in Build" which worked fine, it logged in the console.

After all this I tried it again, but nothing have changed, the error still comes up if I press the Image quickly for around 10 times.

o4401

  • Playmaker Newbie
  • *
  • Posts: 10
Re: Strange error that I don't understand
« Reply #5 on: January 14, 2020, 02:22:38 PM »
By the way this seems to be the same error that comes up if I put a UI On Pointer Down Event action and a UI On Pointer Up Event action in the same state.

Meanwhile I managed to bypass this issue by creating a separate FSM for listening to pointer up and down events and sending the results to other FSM's by global events.

So using UI event listeners simultaneously in different FSM's of a gameobject is not a good idea.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Strange error that I don't understand
« Reply #6 on: January 16, 2020, 08:11:05 AM »
Hi,

these tools takes time to process, you need to let it run until Unity editor comes back active again.

you can definitly use several event listeners on a gameobject in different Fsm, there should be no limitation on that.

Could you make a small repro case? If I can repro locally, then this will help pin point the problem.

Bye,

 Jean