Using Different Death Animations or Death Actors for different death scenarios.

BryceVanceBryceVance Member Posts: 13
edited December 2013 in Working with GS (Mac)
I am currently working on a platform game and there are several different areas for the main character to die. Does anyone know how to make it so that if he dies on land it will spawn one actor and if he dies lets say in water a different actor will spawn? the way that my actors life is set up is by using a boolean attribute called death which destroys my actor when its true which activates when my health bar reaches 0/10.

Comments

  • mc99093mc99093 Member, PRO Posts: 133
    This is how you would use different animations for various deaths.

    You need another attribute along with the death attribute. ex. situation.

    Use a integer attribute for this. 1 = death in water 2 = fall ....etc.

    when collide with water change integer to 1
    when fall change integer to 2.

    if death is true and integer =1 (collide with water) animate chosen animation
    if death is true and integer =2 (fall) animate chosen animation
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    And really, you don't need the boolean, but if it's easier to leave it in place you can. What you described is a game with multiple death states for the player. A boolean is only useful for two states: alive and dead. Use an integer as @mc99093 suggested. Zero can be alive and a positive value can indicate a specific death state.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • BryceVanceBryceVance Member Posts: 13
    Thanks that worked perfectly. :)
Sign In or Register to comment.