toggle menu
Categories
Discussions
Dashboard
Sign In
·
Register
Sign In
·
Register
Categories
Discussions
Dashboard
Sign In
·
Register
×
Home
›
GameSalad 101
›
Working with GS (Mac)
How do I make an enemy rotate to my player and shoot it?
FungoEntertainment
Member
Posts:
36
April 2010
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
VoidedSky
Member
Posts:
1,095
April 2010
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!
Warning
There was an error rendering this rich post.
FungoEntertainment
Member
Posts:
36
April 2010
Thanks!
FungoEntertainment
Member
Posts:
36
April 2010
Could you please tell me just which template it is, so that I can check?
Sign In
or
Register
to comment.
Comments
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!