playMaker

Author Topic: Get Next Raycast 2D "indexOutOfRange"  (Read 1993 times)

johanesnw

  • Playmaker Newbie
  • *
  • Posts: 26
Get Next Raycast 2D "indexOutOfRange"
« on: April 24, 2014, 01:52:51 AM »
I'm using "Get Next Ray Cast 2D" action here
http://i1260.photobucket.com/albums/ii566/ind0dark/raycast2d_zpsb017f0db.png

when the enemy attacks for the 1st time, it's working nicely.
when attacks 2nd time, it stucks in that state, and this error occurs

Code: [Select]
IndexOutOfRangeException: Array index is out of range.
HutongGames.PlayMaker.Actions.GetNextRayCast2d.DoGetNextCollider () (at Assets/PlayMaker Unity 2D/Actions/GetNextRayCast2d.cs:132)
HutongGames.PlayMaker.Actions.GetNextRayCast2d.OnEnter () (at Assets/PlayMaker Unity 2D/Actions/GetNextRayCast2d.cs:111)
HutongGames.PlayMaker.FsmState.ActivateActions (Int32 startIndex)
HutongGames.PlayMaker.FsmState.OnEnter ()
HutongGames.PlayMaker.Fsm.EnterState (HutongGames.PlayMaker.FsmState state)
HutongGames.PlayMaker.Fsm.SwitchState (HutongGames.PlayMaker.FsmState toState)
HutongGames.PlayMaker.Fsm.UpdateStateChanges ()
HutongGames.PlayMaker.Fsm.DoTransition (HutongGames.PlayMaker.FsmTransition transition, Boolean isGlobal)
HutongGames.PlayMaker.Fsm.ProcessEvent (HutongGames.PlayMaker.FsmEvent fsmEvent, HutongGames.PlayMaker.FsmEventData eventData)
HutongGames.PlayMaker.Fsm.Event (HutongGames.PlayMaker.FsmEventTarget eventTarget, HutongGames.PlayMaker.FsmEvent fsmEvent)
HutongGames.PlayMaker.Fsm.Event (HutongGames.PlayMaker.FsmEvent fsmEvent)
HutongGames.PlayMaker.Fsm.Event (System.String fsmEventName)
PlayMakerFSM.SendEvent (System.String eventName)
Enemy_Status.Attack () (at Assets/Scripts/Game/Enemy_Status.cs:48)

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Get Next Raycast 2D "indexOutOfRange"
« Reply #1 on: May 07, 2014, 09:06:56 AM »
Hi,

you are likely deleting the object from the list and the list gets out of synch.

 Have you been able to fix this ( going trhough the backlog, so you may have solved it already)

bye,

 Jean