Spawned actors spawning actors that follow

Alien8Alien8 Member Posts: 37
edited November -1 in Working with GS (Mac)
Thanks in advance for any ideas on this problem: I have a side-scroller game where spaceship actors are being spawned, up to 5 at a time, randomly along the Y axis offscreen on the right, moving towards the left. When the spaceships either gets hit with the player's bullet actor or goes offscreen to the left, it is destroyed.

I would like to have each spawned spaceship actor to spawn its own engine thrust actor (which has a couple of animated frames) and when the spaceship actor is destroyed, its engine thrust actor is destroyed with it. Is there a way to accomplish this feat? Thanks again.

Comments

  • okimokiokimoki Member Posts: 159
    In think there is no way to do that since you caanot name spawned instances and therefore you cannot tell actorst to follow that instance.. Best way to do it is to do complete animation of the entire ship including thrusters..
  • Alien8Alien8 Member Posts: 37
    Aha! Thanks tshirtbooth. With a little tweak, that worked (actually i figured it out right before I saw your post, but was wondering if someone had an answer. The trick is to have a timer with a rule in the thrust to overlap .01 seconds after the ship appears, otherwise the thrust will think it's overlaps/collides = 0 because both come in at the same time. Weird but it works beautifully.
  • okimokiokimoki Member Posts: 159
    menmortal9: how do you spawn a ship, spawn a thruster and then make that specific thruster follow that specific ship??
  • Alien8Alien8 Member Posts: 37
    I just have the thruster have the same move attribute as the ship. The thrust appears to be attached, but is actually just doing the same thing the ship is. My ship spawns are all going in a straight line so it's easy for this project.
  • okimokiokimoki Member Posts: 159
    oh, i get it! I taught you actually figured out how to attach something to a spawned actor :)
Sign In or Register to comment.