Default Value as None

NodeCanvas Forums General Discussion Default Value as None

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #8691
    atmuc
    Participant

    i have a field like;

    public BBParameter<Vector2> DragAmountDelta;

    how can i set None as default value for this?

    #8699
    Gavalakis
    Keymaster

    Hey,

    The easiest way would be this:

    Also remember that if you only want to allow selection from the Blackboard and not allow a direct value assignment, you can use the
    [BlackboardOnly] attribute above the field.

    Cheers!

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

    #8698
    atmuc
    Participant

    thanks. it worked like i expected. in that way i will prevent overriding existing values.

    #8697
    atmuc
    Participant

    i have a problem 🙂 i use following action. i change SourceGO to direct value in unity.i set an game object from scene. it is not prefab. it works when i play it. when i restart unity or build project SourceGO field is empty. is it normal?

    #8696
    Gavalakis
    Keymaster

    Hey,

    I just re-checked this and works as expected. Hm…
    I know you said that the game objecty you reference is not a prefab, but is the GraphOwner a prefab, or the Graph a non-bound graph reference (an Asset graph)?

    This is the only thing I can think of going on here. Can you confirm?

    Unity does not allow having a scene reference IN a prefab or asset reference. You can have an asset reference IN a scene object.

    Thanks.

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

    #8695
    atmuc
    Participant

    none of them prefab. i will also test it with an empty scene. maybe another thing cause my problem. i will also check it another platform than Android.

    #8694
    atmuc
    Participant

    when you set FSM as Asset it does not work for GameObject reference. when i set FSM as Bound it works fine. i think you rechecked it as Bound 🙂

    #8693
    atmuc
    Participant

    is it the same for you?

    #8692
    Gavalakis
    Keymaster

    Hey,

    Sorry for late reply.

    I think I understand the problem here 🙂

    Graph Assets and Unity assets in general, can’t have references to scene objects. This is a Unity known limatation. It’s simply impossible 🙂

    Bound Graphs exists exactly for that reason. To allow you to assign scene object references within the graph.
    If you want to use Asset Graphs, the way to work with scene object references like game objects, would be to use Blackboard variables. Since the Blackboard is a component attached on the agent which is not an asset but in the scene, it CAN have references to other scene objects.

    Let me know if this helps.

    Cheers!

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

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