How to switch actors/ animation when they get damage?

vcano

  • Posts: 5
I have been trying to figure out, try to code and seeing every function but I am stuck. I want to try and change my actor to a damage actor when they get hit. I am working on a space shoot em up by the way.

Been looking around everywhere but cannot seem to find it or figure out on how to do a transition from it. I try using the switch function and made a new actor and animation for the damage but cannot seem to find out on how to switch between my normal looking ship to a damaged ship before it get hit again to be destroyed.

gplar

  • Posts: 1115
Assuming you have an animation Animation 0 for your undamaged ship, create another animation (on the same actor) Animation 1 for damaged ship.
Then when ship is damaged you use the "Switch animation to"  block to change animation to damaged.
You´ll find the block under Actor-Draw.

vcano

  • Posts: 5
Yeah I got that part and tried to do that but the problem is that I tried to click on the animation white box and does not appear at all especially choices. I have the damage ship in the same place as my non damage ship. Also where will I put this block under? Sorry for all the question. New here. >. <

mjones

  • Posts: 3
You need to create an actor animation behavior attribute for the actor you want to switch. When you attach the behavior to the actor you will then be able to select the animation that it will store to the variable.