Second Spawned Actor Position

tom.tomtom.tom Member Posts: 22
edited November -1 in Working with GS (Mac)
So I have an actor that spawns enemies. I created two attributes to track the enemies x and y position. However, it only tracks the 1st actor on the scene, until it is destroyed, THEN it tracks the next one. Is there a way for me track the second actor that is spawned regardless of whether the first enemy has been destroyed or not?

Thanks
tom.tom

Comments

  • reddotincreddotinc Member Posts: 653
    You would need to create two sets of attributes, and after spawning the first actor tell the second actor to use the second set of attributes, if that makes sense?
  • design219design219 Member Posts: 2,273
    You could also probably do this by making two identical enemy actors, and spawn them alternately. I'd have to think about that. How ever you do it, it will involve more attributes, and if you have to have many enemies, it will get very tricky... but very doable, I'm sure.

    _________________________________

    HOLY NOSE JOB!: Nesen Probe: Is this the single most unappealing game in the history of GameSalad? I can't seem to give it away! Anywhere. But if anyone want's to try it out, codes are still available! http://gamesalad.com/forums/topic.php?id=8097
  • tom.tomtom.tom Member Posts: 22
    Thanks for the responses reddotinc and design219.

    @Reddotinc
    How do I access the second actor's attributes that spawns though?

    @ Design219
    Alternate spawning may work and ill be sure to give that a try. Kinda intimidated by all the attributes that I would have to add but I'll give it a try.
    My game is basically a tower defense game so im not too sure how alternating the actors would help. Kinda hard to get the logic in my head without actually trying it in GS though.

    Thanks, ill be sure to post my results.

    Any other solutions or ways?
  • reddotincreddotinc Member Posts: 653
    You can set them as global attributes rather than within an actor, then you can access them whenever.

    // Red Dot Inc
Sign In or Register to comment.