spawning & destroying an actor on touch
jonmulcahy
Member, Sous Chef Posts: 10,408
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.
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
If not, you could just have the actor off screen, and when you touch the screen the position of that actor is moved there.
If not, you could just have the actor off screen, and when you touch the screen the position of that actor is moved there.
Send and Receive Data using your own Server Tutorial! | Vote for A Long Way Home on Steam Greenlight! | Ten Years Left