spawning & destroying an actor on touch

jonmulcahyjonmulcahy Member, Sous Chef Posts: 10,408
edited November -1 in Working with GS (Mac)
I'm trying to work out a problem. I want a user to be able to tap anywhere on the screen and span an actor. If they tap again, I want that first actor destroyed and a new actor spawned at the new touch point.

Is there an easy way to do this? I've come up with some complicated way of doing it, but it doesn't work that well.

I setup a test with an attribute called spawned. When the user taps that spawned is changed to 1, and the actor is created. when the user taps again the attribute is set back to 0. the first actor is destroyed.this is the problem, it requires two taps, one to clear and one to spawn.

Comments

Sign In or Register to comment.