How do I Make a Eye on an Enemy that will follow you?

Get help using Construct 2

Post » Fri Feb 19, 2016 12:13 am

Hey, I just want to make like an Eye on a Enemy Follow the Player, no matter if The Player is up in the air or down below or whatever. I want to make it that The Enemy would shoot A Laser out of its eye.
So how do you make an eye of a enemy that follows the Player?
*Insert Signature here*
B
13
S
5
Posts: 73
Reputation: 1,090

Post » Fri Feb 19, 2016 1:47 am

I would use two sprites, one for the enemy, one for the eye.

You can pin the eye sprite to the enemy sprite so that they move together.

The eye sprite should be slightly off center from its origin point.

Every tick, set the angle of the eye sprite towards the player. You can get this angle by using the expression angle(eye.x,eye.y,player.x,player.y)
Mistakes were made.
B
47
S
23
G
107
Posts: 1,571
Reputation: 60,133

Post » Fri Feb 19, 2016 2:21 am

oosyrag wrote:I would use two sprites, one for the enemy, one for the eye.

You can pin the eye sprite to the enemy sprite so that they move together.

The eye sprite should be slightly off center from its origin point.

Every tick, set the angle of the eye sprite towards the player. You can get this angle by using the expression angle(eye.x,eye.y,player.x,player.y)


Thanks, I'll try it!
*Insert Signature here*
B
13
S
5
Posts: 73
Reputation: 1,090


Return to How do I....?

Who is online

Users browsing this forum: jwilkins, maordany, Phacanu and 8 guests