Remove actor?
Adrenaline
Member Posts: 523
Hi all,
So I'm having an issue with removing an actor.
Right now, I have one actor with a behavior to spawn another actor, triggered by the user's touch.
This new actor is spawned directly on top of the first, touched actor. I want the new actor to be destroyed when the user lifts their finger.
So basically, tap this guy ---> an actor appears
Release your finger from the screen ---> that new actor is removed
As I have it, the new actor appears. But I can't seem to figure out a way to have that actor destroyed when the user is no longer touching.
Any help is appreciated!
Thanks,
So I'm having an issue with removing an actor.
Right now, I have one actor with a behavior to spawn another actor, triggered by the user's touch.
This new actor is spawned directly on top of the first, touched actor. I want the new actor to be destroyed when the user lifts their finger.
So basically, tap this guy ---> an actor appears
Release your finger from the screen ---> that new actor is removed
As I have it, the new actor appears. But I can't seem to figure out a way to have that actor destroyed when the user is no longer touching.
Any help is appreciated!
Thanks,
Comments
What kind of game do you have set up? If it is a static screen (just one screen), you could set up a grid of touch boxes, but more info will be needed before more suggestions come.
It is a static screen. Basically, I want the user to touch an actor and then that actor changes appearance and behaviors. When the user releases the touch, it reverts back to its original appearance and behaviors. I thought the best way to do this would be to have an actor (with the new appearance and behaviors) spawn...and destroy when it's not being touched by the user.
I'm not sure if the alpha idea will work, because that means it's there the entire time, right? So it's behaviors will be active. Maybe I could set a rule that only activates the behaviors when its alpha is 1?
When Touch is pressed:
Change Alpha to 0
Otherwise:
Change Alpha to 1