Spawner enemies can't move towards Actor

Hello all.

So i'm making a "shoot em up" as my first project in GS.

Everything works fine, but i want my spawner enemies to accelerate towards my Actor. How do i make the spawner enemies to automatically move towards my actor?

Comments

  • SajadKazalSajadKazal Member Posts: 20
    • I know how to do it when its a single enemy, but when my spawner spawns multiple enemies, then i cant make them move towards my actor
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949

    Constrain two real game attributes called game.playerX and game.playerY to the player's self.position.X and self.position.Y attributes. Then, in the enemy actor(s), have them move towards game.playerX and game.playerY.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • SajadKazalSajadKazal Member Posts: 20

    Hey all, i asked for a couple of days: Why can't i make my spawner minions to follow my main actor?

    • and the advice i got didn't help. I've made an attribute for my actor X and Y but it still don't work only when i make a single enemy

    I can only make an enemy follow my actor but not a spawner enemy

    so this is the code for my spawner: http://imgur.com/w85HKcd

    anyone know why i can't make spawner enemies to attack my main actor?

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949

    I merged your two threads. Please don't create new threads for the same issue. You can find your existing discussion threads at the top-right of the forums page under My Discussions.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949

    Your rule for following the main actor is in your spawner actor. If you want your spawned enemies to follow the main actor, you need to place that rule in the spawned actor.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • SajadKazalSajadKazal Member Posts: 20

    Thank you tatiang, it worked. Sorry about creating a new thread, won't happen again.

Sign In or Register to comment.