Spawn actor when key is down, but destroy when up?
beast22ros
Member Posts: 14
So i have this game where i have this jet flying up and down. I have a flame actor set to be constrained to the jet actor. What i want is that the flame disappears when the jet is going down. (Space to go up - release to fall). I can't get this easy problem answered anywhere! Any help would be appreciated.
Best Answers
-
RabidParrot Formally RabidParrot. Posts: 956
If space bar is up
Change attribute self.color.alpha to 1
otherwise change attribute self.color.alpha to 0
-
RabidParrot Formally RabidParrot. Posts: 956
I originally read your question wrong, so I updated my first post accordingly.
Answers
@beast22ros
You just need to make the flame image display only when your button (or touch) is pressed. Then, by default, if the button is not pressed, it should not display.
Mathtap.com (Android) | Fridgemanager.com (Android) | Breakoutofspace.com (Android)
@Summation i just tried that, but the image still stayed there, the only thing that changed is that the animation starts whenever i press the key
@RabidParrot didnt work
@RabidParrot thank you very much worked perfectly!