playMaker

Author Topic: [Solved] Error when Get Property  (Read 214 times)

Aaddiction

  • Full Member
  • ***
  • Posts: 146
[Solved] Error when Get Property
« on: November 28, 2021, 12:27:42 PM »
I get the following error when I try to get property from a script. What could be the issue here?

TargetException: Non-static field requires a target
System.Reflection.MonoField.GetValue (System.Object obj) (at <695d1cc93cca45069c528c15c9fdd749>:0)
HutongGames.PlayMaker.FsmProperty.GetValue () (at C:/Projects/Playmaker_1.9.0/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/FsmProperty.cs:421)
HutongGames.PlayMaker.Actions.GetProperty.OnEnter () (at Assets/PlayMaker/Actions/UnityObject/GetProperty.cs:26)
HutongGames.PlayMaker.FsmState.ActivateActions (System.Int32 startIndex) (at C:/Projects/Playmaker_1.9.0/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/FsmState.cs:205)
HutongGames.PlayMaker.FsmState.OnEnter () (at C:/Projects/Playmaker_1.9.0/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/FsmState.cs:175)
HutongGames.PlayMaker.Fsm.EnterState (HutongGames.PlayMaker.FsmState state) (at C:/Projects/Playmaker_1.9.0/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/Fsm.cs:2771)
HutongGames.PlayMaker.Fsm.SwitchState (HutongGames.PlayMaker.FsmState toState) (at C:/Projects/Playmaker_1.9.0/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/Fsm.cs:2718)
HutongGames.PlayMaker.Fsm.UpdateStateChanges () (at C:/Projects/Playmaker_1.9.0/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/Fsm.cs:2643)
HutongGames.PlayMaker.Fsm.Start () (at C:/Projects/Playmaker_1.9.0/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/Fsm.cs:1926)
PlayMakerFSM.Start () (at C:/Projects/Playmaker_1.9.0/Projects/Playmaker.source.unity/Assets/PlayMaker/PlayMakerFSM.cs:563)
« Last Edit: November 29, 2021, 08:48:00 AM by Aaddiction »

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 6868
    • jinxtergames
Re: Error when Get Property
« Reply #1 on: November 28, 2021, 12:52:16 PM »
Hi.
Can you show the script?

it looks like the issue lies in the script, see this unity post :
https://forum.unity.com/threads/2018-1-targetexception-non-static-method-requires-a-target.529570/#post-3482731

Aaddiction

  • Full Member
  • ***
  • Posts: 146
Re: Error when Get Property
« Reply #2 on: November 29, 2021, 08:47:48 AM »
Yes, the script was the problem. It wasn't loading the game object I'm referencing.