Actor Animation
Hey everyone.
When my actors are destroyed, an explosion animation happens. But I don't want the same animation to happen every time the actor is destroyed.
Is there a way to have a random animation? So every time the actor is destroyed, a different explosion animation happens?
I want to use at least 3 random explosion animations.
Thanks everyone
- Danny
Best Answers
-
SmokeyAce73 EarthPosts: 370
Sure really easy to do:
Create an integer attribute:
- WhichDeathAnimation
When the actor dies change attribute game.WhichDeathAnimation to random(1,3) - change the 3 to however animations you have
*Create Rule if attribute self.WhichDeathAnimation = 1
Animate with animation 1*Create Rule if attribute self.WhichDeathAnimation = 2
Animate with animation 2*Create Rule if attribute self.WhichDeathAnimation = 3
Animate with animation 3EDIT: Thanks @Braydon_SFX Self not Game
Developer For BLUNTentertainment - Feel Free To Message Me! - Free Beginner Templates!
-
Braydon_SFX Posts: 9,273
Okay, so here's what you'd do:
You'd create a self attribute - integer type.
When the actor is going to be destroyed, change this attribute to random(1,3). This will give it a random value between 1 and 3. You can then create rules that are based off of that attribute value.
For example:
Rule: When attribute self.WhichAnimation = 2,
Animate explosion 2Or
Rule: When attribute self.WhichAnimation = 3,
Animate explosion 3My GameSalad Academy Courses! ◦ Check out my quality templates! ◦ Add me on Skype: braydon_sfx
-
SmokeyAce73 EarthPosts: 370
I'm sure @Braydon_SfX Will say the same but I'm always happy to help!
Developer For BLUNTentertainment - Feel Free To Message Me! - Free Beginner Templates!
Answers
@SmokeyAce73 @Braydon_SFX
Thank you both for your responses. I always get help quickly here on the GS Forums