0
Not a Bug

InvalidOperationException: Missing target object With custom script

Hazukiaoi 1 year ago updated by nsk4u 1 month ago 3

I Create a class TestBoltFunc

code:

using UnityEngine;
public class TestBoltFunc : MonoBehaviour
{
    public void TestFunction()
    {
         Debug.Log("TestFunc");
    }

    public float TestFuncPama(float start)
    {
         return start + 2;
    }
}

and make the node in flow

when i run will error

like it:



InvalidOperationException: Missing target object for 'TestBoltFunc.TestFunction'.
Ludiq.Member.EnsureReady () (at C:/Users/lazlo/Projects/Bolt1/Package/Ludiq.Core/Runtime/Reflection/Member.cs:760)
Ludiq.Member.EnsureInvocable () (at C:/Users/lazlo/Projects/Bolt1/Package/Ludiq.Core/Runtime/Reflection/Member.cs:844)
Ludiq.Member.Invoke () (at C:/Users/lazlo/Projects/Bolt1/Package/Ludiq.Core/Runtime/Reflection/Member.cs:877)
Bolt.InvokeMember.Invoke (Bolt.Flow flow) (at C:/Users/lazlo/Projects/Bolt1/Package/Bolt.Flow/Runtime/Framework/Codebase/InvokeMember.cs:166)
Bolt.InvokeMember.Enter (Bolt.Flow flow) (at C:/Users/lazlo/Projects/Bolt1/Package/Bolt.Flow/Runtime/Framework/Codebase/InvokeMember.cs:250)
Bolt.Flow.InvokeDelegate (Bolt.ControlInput input) (at C:/Users/lazlo/Projects/Bolt1/Package/Bolt.Flow/Runtime/Flow.cs:399)
Bolt.Flow.Invoke (Bolt.ControlOutput output) (at C:/Users/lazlo/Projects/Bolt1/Package/Bolt.Flow/Runtime/Flow.cs:293)
Bolt.Flow.Run (Bolt.ControlOutput port) (at C:/Users/lazlo/Projects/Bolt1/Package/Bolt.Flow/Runtime/Flow.cs:229)
Bolt.EventUnit`1[TArgs].Run (Bolt.Flow flow) (at C:/Users/lazlo/Projects/Bolt1/Package/Bolt.Flow/Runtime/Framework/Events/EventUnit.cs:152)
Bolt.EventUnit`1[TArgs].Trigger (Ludiq.GraphReference reference, TArgs args) (at C:/Users/lazlo/Projects/Bolt1/Package/Bolt.Flow/Runtime/Framework/Events/EventUnit.cs:123)
Bolt.XEventGraph.TriggerEventHandler[TArgs] (Ludiq.GraphStack stack, System.Func`2[T,TResult] predicate, TArgs args, System.Func`2[T,TResult] recurse, System.Boolean force) (at C:/Users/lazlo/Projects/Bolt1/Package/Bolt.Core/Runtime/Events/IEventGraph.cs:48)
Bolt.FlowState.OnEnterImplementation (Bolt.Flow flow) (at C:/Users/lazlo/Projects/Bolt1/Package/Bolt.State/Runtime/FlowState.cs:23)
Bolt.State.OnEnter (Bolt.Flow flow, Bolt.StateEnterReason reason) (at C:/Users/lazlo/Projects/Bolt1/Package/Bolt.State/Runtime/State.cs:147)
Bolt.StateGraph.Start (Bolt.Flow flow) (at C:/Users/lazlo/Projects/Bolt1/Package/Bolt.State/Runtime/StateGraph.cs:120)
Bolt.StateMachine.OnEnable () (at C:/Users/lazlo/Projects/Bolt1/Package/Bolt.State/Runtime/StateMachine.cs:17)
Bolt Version:
1.43f2
Unity Version:
Unity 2018.4.0f1
Platform(s):
Scripting Backend:
.NET Version (API Compatibility Level):
+1

OK, I not put the script to Object

Not a Bug

Glad you figured it out!

Also, if you don't need an instance for the script, just make the method or class static.

can u little explain it. I also get same problem.