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.

    April 7, 2025 at 11:42 am #1435

    The issue start already earlier:
    The namespace name 'SyncLib' doesn't exist in the namespace 'ExcursionXR'

    That means the node doesn’t now about the other script.

    But anyway I found the solution. I was using different script folders and imported them separately. By importing all script in once it works 🙂

    April 8, 2025 at 3:14 pm #1438

    😉 good to know…

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