Default Value as None

Forums 💬 NodeCanvas 🗨️ General Discussion Default Value as None

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

      i have a field like;

      public BBParameter<Vector2> DragAmountDelta;

      how can i set None as default value for this?

      #14407
      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!

        #14406
        atmuc
        Participant

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

          #14405
          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?

            #14404
            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.

              #14403
              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.

                #14402
                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 🙂

                  #14401
                  atmuc
                  Participant

                    is it the same for you?

                    #14400
                    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!

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