How do I make an enemy rotate to my player and shoot it?

FungoEntertainmentFungoEntertainment Member Posts: 36
edited November -1 in Working with GS (Mac)
Basically, that's the question. The enemy is a cannon that doesn't move. Please help-

Comments

  • VoidedSkyVoidedSky Member Posts: 1,095
    Did you check the templates? There is a good templae for that. But heres the code:
    Attribute: game.angleToPlayer

    Player code: constrain game.angleToPlayer to VectorToAngle(self.positionX,self.positionY)

    Cannon code: rotate to angle game.angleToPlayer
    Timer, after 4 seconds spawn actor "Bullet" infront of actor

    I hope this works!
  • FungoEntertainmentFungoEntertainment Member Posts: 36
    Thanks!
  • FungoEntertainmentFungoEntertainment Member Posts: 36
    Could you please tell me just which template it is, so that I can check?
Sign In or Register to comment.