how do i make enemy follow player

Get help using Construct 2

Post » Thu Dec 19, 2013 2:23 am

how do i make enemy follow player when close for my platform game.

anyone have an capx i could look at?
B
8
S
2
Posts: 54
Reputation: 1,001

Post » Thu Dec 19, 2013 3:24 am

You could to check the distance. If Player and Enemy in some distance, enemy -> Follow Player.

First, you can Add event -> System -> Compare two values.

1. On First Value: distance(Player.X, Player.Y, Enemy.X, Enemy.Y)
2. Set the Comparison to less or equal.
3. On the Second value enter the distance you want.

Then add action to follow player. Hope this helps
Creating games makes your imagination realized
B
14
S
4
G
1
Posts: 55
Reputation: 1,130

Post » Thu Dec 19, 2013 3:24 pm

THANK YOU VERY MUCH I WILL TRY IT WHEN I GET HOME TONIGHT..

B
8
S
2
Posts: 54
Reputation: 1,001

Post » Thu Dec 19, 2013 3:55 pm

I hope that it help you:

https://www.dropbox.com/s/coirpys7t012tew/exemple.capx
B
44
S
7
Posts: 79
Reputation: 4,340

Post » Fri Dec 20, 2013 2:30 pm

awesome guys thank you so much. the community is awesome here
B
8
S
2
Posts: 54
Reputation: 1,001

Post » Sat Dec 21, 2013 3:57 am

follow player action?
B
8
S
2
Posts: 54
Reputation: 1,001

Post » Sat Dec 21, 2013 4:03 am

Enable Bullet behaviour on the enemy and then MoveAtAngle(Player)
or
Pathfinding behaviour and set Player as the destination
B
47
S
17
G
81
Posts: 2,224
Reputation: 48,095

Post » Sat Dec 21, 2013 4:26 am

i have tried everything i cannot get a platform enemy to follow my player.
B
8
S
2
Posts: 54
Reputation: 1,001

Post » Sat Dec 21, 2013 4:31 am

It's one of the most basic aspects of C2. In the software go to File > New > Demo Game: Ghost Shooter(Tutorial Version) and look at the enemy logic and the use of the MoveToward command.
B
47
S
17
G
81
Posts: 2,224
Reputation: 48,095


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 21 guests