playMaker

Author Topic: What is the right way to use Call Method action?  (Read 1392 times)

kapitanpattimura

  • Playmaker Newbie
  • *
  • Posts: 4
What is the right way to use Call Method action?
« on: May 02, 2018, 07:33:22 AM »
Hello, team

I am currently struggling to keep Call Method action's method reference saved within the GameObject scene's instance.

Been facing this issue with other cases and able to fix it by applying changes first to the prefab then saving the scene, but does not work for this case.

Did a video with the steps I am following to ease the issue's debugging:
Getting the following exception which related to the UnityEngine's UI:
Code: [Select]
NullReferenceException: Object reference not set to an instance of an object
UnityEngine.GUILayoutUtility.BeginLayoutGroup (UnityEngine.GUIStyle style, UnityEngine.GUILayoutOption[] options, System.Type layoutType) (at /Users/builduser/buildslave/unity/build/Runtime/IMGUI/Managed/GUILayoutUtility.cs:296)
UnityEngine.GUILayout.BeginHorizontal (UnityEngine.GUIContent content, UnityEngine.GUIStyle style, UnityEngine.GUILayoutOption[] options) (at /Users/builduser/buildslave/unity/build/Runtime/IMGUI/Managed/GUILayout.cs:306)
UnityEngine.GUILayout.BeginHorizontal (UnityEngine.GUILayoutOption[] options) (at /Users/builduser/buildslave/unity/build/Runtime/IMGUI/Managed/GUILayout.cs:293)
HutongGames.PlayMakerEditor.StateInspector.DoStateNameGUI (HutongGames.PlayMaker.FsmState state) (at C:/Users/Alex/Documents/Unity/Playmaker/Projects/Playmaker.source.unity/Assets/PlayMaker/Editor/Classes/StateInspector.cs:244)
HutongGames.PlayMakerEditor.StateInspector.OnGUI () (at C:/Users/Alex/Documents/Unity/Playmaker/Projects/Playmaker.source.unity/Assets/PlayMaker/Editor/Classes/StateInspector.cs:189)
HutongGames.PlayMakerEditor.InspectorPanel.OnGUI (Rect area) (at C:/Users/Alex/Documents/Unity/Playmaker/Projects/Playmaker.source.unity/Assets/PlayMaker/Editor/Classes/InspectorPanel.cs:166)
HutongGames.PlayMakerEditor.FsmEditor.OnGUI () (at C:/Users/Alex/Documents/Unity/Playmaker/Projects/Playmaker.source.unity/Assets/PlayMaker/Editor/Classes/FsmEditor.cs:585)
HutongGames.PlayMakerEditor.FsmEditorWindow.DoGUI () (at Assets/PlayMaker/Editor/FsmEditorWindow.cs:92)
HutongGames.PlayMakerEditor.BaseEditorWindow.OnGUI () (at C:/Users/Alex/Documents/Unity/Playmaker/Projects/Playmaker.source.unity/Assets/PlayMaker/Editor/Classes/BaseEditorWindow.cs:117)
System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:222)
Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:232)
System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MethodBase.cs:115)
UnityEditor.HostView.Invoke (System.String methodName, System.Object obj) (at /Users/builduser/buildslave/unity/build/Editor/Mono/HostView.cs:295)
UnityEditor.HostView.Invoke (System.String methodName) (at /Users/builduser/buildslave/unity/build/Editor/Mono/HostView.cs:288)
UnityEditor.HostView.InvokeOnGUI (Rect onGUIPosition) (at /Users/builduser/buildslave/unity/build/Editor/Mono/HostView.cs:255)

Regards,

José

kapitanpattimura

  • Playmaker Newbie
  • *
  • Posts: 4
Re: What is the right way to use Call Method action?
« Reply #1 on: May 07, 2018, 07:54:43 AM »
Hello again,

I noticed that this issue arrises only when you try to call a method from a script from another GameObject.

Regards,

José

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: What is the right way to use Call Method action?
« Reply #2 on: May 14, 2018, 01:49:15 AM »
Hi,

 what method are you trying to call, could you show us your setup in the fsm and action? I'll try to repro.

 Bye,

 Jean