Help with enemies
Hey everyone,
I started a new Project out of the "Official Cross-Platform Controller Template" and I add Enemies. Now I want that the enemies follow the main character. I used "Move To" the Position of the main character. But how can I make that the enemy look on the main character and shoot on him???
Now the enemy move to the character but look on different sides...
What's the problem??
WTDeveloper
I started a new Project out of the "Official Cross-Platform Controller Template" and I add Enemies. Now I want that the enemies follow the main character. I used "Move To" the Position of the main character. But how can I make that the enemy look on the main character and shoot on him???
Now the enemy move to the character but look on different sides...
What's the problem??
WTDeveloper
Comments
In the main character make a behavior that says constrain game.mainx to self.position.x
Then make another constrain attribute behavior that says constrain attribute game.mainy to self.position.y
Then in the enemy, make a constrain attribute and say constrain attribute self.rotation. to vectortoangle(self.position.x-game.mainx, self.positoin.y-game.mainy)
Then just use timer that says every x seconds spawn actor x and then set the direction of the bullet accordingly and the speed.