Actor And Points

Discussion in 'Buildbox 3.0' started by Killjoy1432, Feb 4, 2019.

  1. Killjoy1432

    Killjoy1432 Boxer

    Joined:
    Feb 2, 2019
    Messages:
    33
    Likes Received:
    6
    My actor when defeated still collects points i tried to use the remove node to fix this but if its close enough to any points it will still collect even after being defeated it is set up to explode into a bunch of small spheres debris well the debris collect points also any one got an idea how to make it so that this dont happen
     
  2. Scriv

    Scriv Boxer

    Joined:
    Oct 28, 2018
    Messages:
    50
    Likes Received:
    22
    you need to add a global variable to the process of "adding a point"

    We're going to make a global variable that first tells the game that the character is alive. Then when it collides with a point it'll question "if the character is alive" and lastly we'll tell the game when the character is not alive..... i.e. dead.

    when you start your world just add somewhere in an "innit" function
    Settings['alive'] = 1;

    when your character picks up a point just check if the game is still "in play"... we can add this to the signal function.

    if (Settings['alive'] = 1){
    // add your points code here code here//
    }

    When your character dies you need to add a bit to a signal path to change the "alive" global setting to "0" (i.e. we're dead!)

    Settings['alive'] = 0;

    so whenever your world reloads you're telling the world that the character is "alive", youre asking everytime your character picks up a point "whether or not the character is alive".... AAAAnd when the character explodes you're saying "he's dead"

    The result is that when the character collides with a point it'll still register the collision but it wont add a point because "alive" DOES NOT = 1 Got it? x

    Hope this helps.
     
    Killjoy1432 likes this.
  3. Killjoy1432

    Killjoy1432 Boxer

    Joined:
    Feb 2, 2019
    Messages:
    33
    Likes Received:
    6
    I will have to play around in try this out thanks for your help
     

Share This Page