Playmaker Forum

Bug Reporting => PlayMaker Bug Reporting => Topic started by: Nikaas on February 02, 2018, 09:42:28 PM

Title: InvalidCastException: Cannot cast from source type to destination type.[SOLVED]
Post by: Nikaas on February 02, 2018, 09:42:28 PM
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)



Title: Re: InvalidCastException: Cannot cast from source type to destination type.
Post by: Nikaas on February 04, 2018, 06:57:50 AM
Nwm, it was caused by a broken prefab connection!