How do I spawn a turret

0 favourites
  • 5 posts
  • Hi

    having problems:

    every 5 seconds

    I am creating an object the enemy base, this in turn spawns a turret which sits on the base

    I then pin the turret to the base and give instance variables of each others UID

    when each 5 seconds ticks by the Gun vanishes, or when the base is destroyed the turret jumps to another base

    any help would be greatly appreciated

    (also is it because i have altered scale the crude explosion sprite5 goes way off the mark?)

  • I think you are looking for the container.

    Take sprite4 and add container. Pick NMEturret to add.

    When the base (sprite4) has been destoyd, the NME will be destroyed automaticly aswell.

    Further document can be found here

    Hope it helps, cheers!

  • thanks that does help, the container method does seem to have stopped the enemy turrets from turning though

    but not a bad fix so far thanks and fixed the basic sprites my bad set to another layer

  • In event 3, change the Pin action mode to "Only position" instead of "Position and Angle". This fix the problem.

    This might explain why your NME didn't rotate after applying the container.

    [quote:1wpdr1b1]3. If a condition picks one object in a container, every other associated object in its container is also picked.

    You have an event (16) to set the angle of sprite4 to the player. Since NME is in the container of sprite 4 and also have the Pin action mode "Position and Angle" in event (3), NME will pick the angle of sprite4 everytick.

    I find myself enjoying your game. Keep it up! I am looking forward to playing with upgrades and more

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Great spot thank you very much!

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)