Destroying actor when health bar disappears
skippy
Member Posts: 106
Hi I'm trying to figure out how to destroy my actor after the health bar has come to the end and vanished, i made the health bar after watching tshirtsbooth's video and everything works well when the actor collides and the health bar shrinks but iv'e searched and can't work out how to destroy the main actor after the life bar is gone ?
I'm assuming it would be another constrain attribute and when the health bar size gets to zero destroy this actor but i'm not sure.
I'm assuming it would be another constrain attribute and when the health bar size gets to zero destroy this actor but i'm not sure.
Comments
go on your life bar and create rule when self.size.X = 0
change attribute "Destroy 1" to 1
Then go to the actor you want to destroy:
create rule:
when attribute "Destroy 1" = 1
destroy actor
i think that should work if i have actually understood what you are doing
it worked a treat and while i got you you might know this as well, if there is a following actor to the main actor that was destroyed and you want the following actor to fall down when the main actor is destroyed how would i do this. I tried change velocity 270, move 270, accelerate 270 and the following actor remains on the screen where the main actor was destroyed but i can't get it to fall but i can destroy it when the main one is destroyed, is this due to the constraining attributes ?
So in the "following" actor this what i did :
create rule, attribute game.lifebar = 0
destroy this actor (which works)
but none of the above work, and i would prefer the following actor falling rather than destroying, any idea's ?
Reseting everything can be also done with the same attribute, which is used to destroy the main actor.
For example if there is a fish tank on the screen and a fish inside the tank, the constraining attributes keep the fish in the tank (self .position.x) to (game.Target x)and (self.position.y) to (game.target y) and this is in the main actors attributes as well ,when the tank gets destroyed the fish stays where the tank was destroyed where as i want the fish to fall down and iv'e tried different combinations but everything i try the fish remains where the tank was destroyed what do you think ?