How To Properly Make "taking Damage" Animation In Bb3?

Discussion in 'Buildbox 3.0' started by nyamuk91, Dec 27, 2018.

  1. nyamuk91

    nyamuk91 Boxer

    Joined:
    Aug 15, 2018
    Messages:
    95
    Likes Received:
    20
    So, in BB2, objects can have a custom "taking damage" animation. I tried to do this in BB3 by having an Animation node after the object/entity taken damages. However, I have 2 problems:
    1. The animation doesn't seem to overwrite the object original sprite. Instead, the animation plays on top of the original sprite
    2. The animation didn't disappear after it ended. The only way to make it disappear is by adding an extra transparent frame at the end of the animation
    Also, is there any way to programmatically do simple animation (e.g. change the opacity, position, rotation, etc) within a single node? I know I can make fake animation effect by making multiple Custom Script nodes that will each set the entity positions but this doesn't look very clean. For example, I can do this:
    1. Custom Script 1: this.entity().setPosition(pos.x+2,pos.y+2,pos.z)
    2. Custom Script 2: this.entity().setPosition(pos.x+2,pos.y+2,pos.z)
    3. Custom Script 3: this.entity().setPosition(pos.x+2,pos.y+2,pos.z)
    4. Custom Script 4: this.entity().setPosition(pos.x-6,pos.y-6,pos.z) //Return to original position
     

Share This Page