Copied actors - not duplicated actions

mythicappsmythicapps Member Posts: 82
edited November -1 in Working with GS (Mac)
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?

Comments

  • DreamLabDreamLab Member Posts: 2,127
    yah man you can't copy your actors from one project to the other. try the project merger. if thats what your doing. there have always been problems with copying actors.
  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    try this

    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
  • mythicappsmythicapps Member Posts: 82
    Hey John;

    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.

    screen1
  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    you combined them to much, it should be like this

    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
  • mythicappsmythicapps Member Posts: 82
    Hey John;

    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.

    Screen3
Sign In or Register to comment.