How Can I Disable A Node In A Object During Game?

Discussion in 'How Can I...?' started by MarcL, Jan 26, 2020.

  1. MarcL

    MarcL Boxer

    Joined:
    Nov 15, 2018
    Messages:
    17
    Likes Received:
    0
    Hey Guys,

    if the character collides with a object I want a node in the collided object to be disabled, so that a single process stops. Is it possible during game to stop single nodes?

    THX
     
    Last edited: Jan 26, 2020
  2. jmp909

    jmp909 Boxer

    Joined:
    Feb 2, 2020
    Messages:
    28
    Likes Received:
    4
    Say you have an object with a Rotate node, and the Start node's Created pin wired up to the Rotate node's Enabled pin

    If you also have an If Collide node as well, wire it up to a Script node and wire the Out pin to the Rotate node

    Now change the script to say on your Script node to just have this on it
    Code:
    function signal(name, value) {
    this.emitSignal('Out', false);
    }
    then when something collides with this object, the rotation will stop, since the collision triggers the signal on the Script to send false to the Rotate component

    you could also use a Send/Receive node system to fire the message from the colliding object instead
     

Share This Page