Disabling a specific component

Forums 💬 NodeCanvas 🗨️ General Discussion Disabling a specific component

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #14510
    async0x42
    Participant

      Is there a provided Task for disabling/enabling a specific component of a GameObject? Similar to the reflection used in running a function, but it only reflects the components and lets you select one for modifying.

      I looked around and wasn’t able to see one, but I’m not sure if I missed it. (If there isn’t one, is that possible for a future release?)

      Thanks again for the great asset!

      #14516
      async0x42
      Participant

        This photo is what I mean, i.e, having a simple way to enable/disable a component via reflection, as though you clicked “Select Method” in this example. Instead, it’d be “Select Component”, and just display the Components for selection

        #14515
        Gavalakis
        Keymaster

          Hello,

          Sorry for the late reply.
          You can use the SetProperty reflection task for that and set the .enabled property of the component. Is that what you mean?

          Thanks.

          #14514
          async0x42
          Participant

            Oh, I didn’t think about that at all, that’s exactly what I was wanting, thanks for your help!

            #14513
            andy miira
            Participant

              Sorry for the necro, but I wanted to ask, if it would be possible to add a SetEnabled action task (where you set a component reference and its desired .enabled value), in a future NodeCanvas version?

              I think that would be more intuitive than the SetProperty method, simpler to use, just like the SetActive action task for GameObjects.

              #14512
              Gavalakis
              Keymaster

                Hello there and no problem for necro 😛
                Of course. I have just made and added a SetEnable action task. I’ve also attached it for you here, but it will also be there in the next version 🙂
                Thanks!

                #14511
                andy miira
                Participant

                  Thank you for adding the SetObjectEnabled action task! It worked perfectly 😀

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