2d Game Character Doesn't Die No Matter What

Discussion in 'Buildbox 3.0' started by Deems Coppertin, May 4, 2020.

  1. Deems Coppertin

    Deems Coppertin Boxer

    Joined:
    Aug 8, 2018
    Messages:
    8
    Likes Received:
    1
    Hi everybody. Ran into something super annoying in a 2D game I started from a blank file. Maybe someone can shine some light on this insanity.

    So I have my main character, a ball, I have it moving forward, I put a spike in front of it and set the spike to 'Enemy' when the character touches it nothing happens. It doesn't die.

    I tried every single type of physics setting, tried giving the character 'If Collide' with 'Enemy'---> 'Defeat' function but that doesn't work either. I tried all kinds of logical ways to make this happen but nothing. Looked how this is done in the 'Platformer' template and all the settings there are exactly the same as mine.

    Is this some kind of a giant bug or is there in ILLOGICAL thing I have to do in order to kill of a character?

    Thank you in advance for your replies guys.
     
  2. spicedbeangames

    spicedbeangames Miniboss Boxer

    Joined:
    Mar 31, 2016
    Messages:
    1,340
    Likes Received:
    560
    With the spike, click on the START node and to the right, select the physics to static(if it doesn't need to move). Underneath, select the 'Affected asset' to NONE.

    Then head over to your character
    Use a Collide node and select it. Check the collision shape etc is right, then under that, you see 'Affected Asset' - Set this to the name of your enemy. Or if you are using 'Enemy' as in general, type that in.

    From your collide node, add DEFEAT node - and then attach to the collide, then any defeat animation on the defeat part of the node.
    From the defeat node, also attach a delay and set any time you need (to play the death animation for example), before the Game over UI appears.

    Then create a GAME OVER UI, use the event observers and link to the defeat node. Ive added an image to help
    bandicam 2020-05-04 15-52-58-810.jpg
     
  3. Deems Coppertin

    Deems Coppertin Boxer

    Joined:
    Aug 8, 2018
    Messages:
    8
    Likes Received:
    1
    Hey, thanks for the reply!! So the only difference from what I was doing was setting the Affected Asset to NONE and that did fix it. So it WAS the illogical move that solved the problem after all :) Thank you so much for the help!
     

Share This Page