Copied actors - not duplicated actions
![mythicapps](http://forums.gamesalad.com/applications/dashboard/design/images/defaulticon.png)
Hey All;
OK, I have a couple of spaceship graphics I am using, I have set the move functions to follow touches, which is sorta working. But I just realized that when the spawn function brings them onto the screen they all follow the same movement. In other words when I touch one of them and move it, all the spawned copies do the same. WTF???
How do I fix this?
OK, I have a couple of spaceship graphics I am using, I have set the move functions to follow touches, which is sorta working. But I just realized that when the spawn function brings them onto the screen they all follow the same movement. In other words when I touch one of them and move it, all the spawned copies do the same. WTF???
How do I fix this?
Comments
make a self attribute in the actor thats spawning, ill call it touchon as a example
you can make it a interger and have it set to 0, and make sure its a self attribute in the actor.
make a rule when touch is pressed change attribute touchon to 1
then in the otherwise section of that rule put a change attribute behavior changing touchon to 0
then put the move and touch rules in a rule that is when attribute self touchon is 1
that will keep them seperate and apply only to the actor u touch
cheers
I followed your instructions exactly, but what happens is that all the spawned ships still follow where the touch goes, but now they do it even when the touch is released. Not sure what I am doing wrong here is the rule.
A rule when actor recieves event touch is pressed
-change attribute self.touch on to 1
then in the otherwise section of that rule change attribute self touch on to 0
Thats it for that rule, nothing else should be in that besides that.
Then make another rule when attribute self touch=1
Then put the timer and change velocity in there
cheers
OK I made a few changes when I realized that I had put this rule in the spawn rule. Doh!
I put the rules into the rule of the shop being spawned. However all the spawned ships follow the touch as soon as they are touched. I want one ship to follow the touch, and then stop following when the touch is done.
I am fighting with two things at once. 1 getting the ships to follow the path the touch (drag and make a path) makes but follow slowly. Separate thread
2. make each spawned ship behave separately. Here are the rules as they now exist for the ship.