How do I access singleton instance public properties?

NodeCanvas Forums Support How do I access singleton instance public properties?

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #16211
    ccfoo242
    Participant

    Building an FSM. I see where I can create a blackboard variable of the Instance but when I try to create a variable referencing one of the properties I get this error when I run it:

    (Variable Error): A Blackboard Variable ‘HasDoubleClickedPiece’ is due to bind to a Component type that is missing ‘MouseManager’. Binding ignored.

    I cam work around this by adding a read only property in my agent that returns the Instance property but I would rather just reference the instance itself.

    Is this possible?

    #16212
    Gavalakis
    Keymaster

    Hello there,

    Does the “MouseManager” component actually exist on the same gameobject as the blackboard?  Variables can only be bound to properties on components attached on the same gameobject the blackboard is (unless the property is static in which case it does not matter of course). This is done by design to avoid the blackboard having references from all over the scene. Is binding a property from a component NOT attached to the blackboard gameobject what you are trying to achieve?

    Thanks!

    Join us on Discord: https://discord.gg/97q2Rjh

    #16213
    ccfoo242
    Participant

    Ah ok. Yes, MouseManager is on a different GameObject. I could probably combine them all to a single managers gameobject. What I’m working on is implementing the main loop as a FSM. Perhaps that’s not a good idea? Maybe I should create separate FSM’s for each manager’s duties?

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.