Disabling a specific component

NodeCanvas Forums General Discussion Disabling a specific component

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #8804
    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!

    #8807
    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

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

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

    #8805
    Async0x42
    Participant

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

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

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

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

    Attachments:
    You must be logged in to view attached files.
    #15560
    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.