playMaker

Author Topic: InvalidCastException: Cannot cast from source type to destination type.[SOLVED]  (Read 2304 times)

Nikaas

  • Playmaker Newbie
  • *
  • Posts: 18
I have a class RectCheck that derives from ScriptableObject.
In an FSM there is FSMObject variable that links to RectCheck asset file.
In an action, I try to cast FSMObject.Value to RectCheck and get the error.
In another FSM exactly the same action with exactly the same asset file linked through FSMObject variable and there all works.
unity 2017.2 PM 1.8.9 , the action is attached

The full exception is:
InvalidCastException: Cannot cast from source type to destination type.
Pixelhalf.CustomPlayMaker.Actions.IsWithinHorizontalRange.TryEvent () (at Assets/AssetsPlugs/PlayMaker/My Actions/IsWithinHorizontalRange.cs:88)
Pixelhalf.CustomPlayMaker.Actions.IsWithinHorizontalRange.OnUpdate () (at Assets/AssetsPlugs/PlayMaker/My Actions/IsWithinHorizontalRange.cs:67)
HutongGames.PlayMaker.FsmState.OnUpdate () (at C:/Users/Alex/Documents/Unity/Playmaker/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/FsmState.cs:265)
HutongGames.PlayMaker.Fsm.UpdateState (HutongGames.PlayMaker.FsmState state) (at C:/Users/Alex/Documents/Unity/Playmaker/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/Fsm.cs:2710)
HutongGames.PlayMaker.Fsm.Update () (at C:/Users/Alex/Documents/Unity/Playmaker/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/Fsm.cs:1934)
PlayMakerFSM.Update () (at C:/Users/Alex/Documents/Unity/Playmaker/Projects/Playmaker.source.unity/Assets/PlayMaker/PlayMakerFSM.cs:539)



« Last Edit: February 04, 2018, 07:55:46 PM by djaydino »

Nikaas

  • Playmaker Newbie
  • *
  • Posts: 18
Re: InvalidCastException: Cannot cast from source type to destination type.
« Reply #1 on: February 04, 2018, 06:57:50 AM »
Nwm, it was caused by a broken prefab connection!