Issues with calling a public runtime script method with a button press.

Welcome to Portals United! / Forums / Troubleshooting / Issues with calling a public runtime script method with a button press.

  • Author
    Posts
  • April 2, 2025 at 2:38 pm #1427

    Hi, I want to call a method with a simple button press. The idea is to connect the Button Signal to a simple node and call the public method inside the RunAction. Is this possible / intended to work? What is the recommended way to do this?

    When I try it I get the error message that my AutoAdaptiveManager (RuntimeScript) doesn’t exist:

    Node:
    using ExcursionXR.SyncLib;
    namespace ExcursionXR.Nodes{
    public class PlacementNode : NodeBase { // fully identically to 'MyDebugNode'
    ...
    public void RunAction() { AutoAdaptiveManager.Instance.PlaceAll();}
    }

    RuntimeScript:
    namespace ExcursionXR.SyncLib {
    public class AutoAdaptiveManager : DataComponentBase
    ...
    private void Start() { Instance = this; }
    public void PlaceAll() {}
    }

    Unfortunately it seems that runtime scripts doesn’t exist for nodes. Are they compiled separately?

    What should I do?

    April 3, 2025 at 4:00 pm #1433

    I guess, send me your node code and I’ll check what’s wrong with it. Are you sure that the script which has an Instance variable is added somewhere to a GameObject? Otherwise the class was never instantiated and really doesn’t exist.

  • You must be logged in to reply to this topic.