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

    Nov 15, 2018
    Likes Received:
    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?

    Last edited: Jan 26, 2020
  2. jmp909

    jmp909 Boxer

    Feb 2, 2020
    Likes Received:
    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
    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