Pick Nearest

Get help using Construct 2

Post » Sat Sep 07, 2013 2:38 pm

Hi there,

I'm currently making a overhead zombie game where there are civilians (NPC'S).

I'm wanting to know if it's possible to make the zombies go to the nearest Civilian on the map and not just any random civilian.
B
8
S
2
Posts: 15
Reputation: 630

Post » Sat Sep 07, 2013 3:15 pm

@constructchris, this should help you :)

Pick (nearest) instance in expression
B
33
S
6
G
7
Posts: 494
Reputation: 8,252

Post » Sat Sep 07, 2013 3:21 pm

Not exactly what i was look for.

So far I have made it so it randomly spawns 50 Civilians on the map and 5 zombies, all I need now is for the zombies to go to the nearest Civilian
B
8
S
2
Posts: 15
Reputation: 630

Post » Sat Sep 07, 2013 3:33 pm

capx please.
How are the zombies moving? Do they have a bullet behavior and set their angle to the civilians every tick? If yes, say hello to Turret behavior. It automatically sets your sprite's angle to another sprite, or a group of sprites. You need to add the objects to the behavior on start of layout (forgot the condition's name), and it rotates to look exactly at it's target. And if you search Turret's properties a bit...
HARMLESS SIGNATURE THAT IS VIEWED BY OTHERS AS OFFENSIVE AND CONTROVERSIAL
B
14
S
3
G
3
Posts: 356
Reputation: 4,377

Post » Sat Sep 07, 2013 3:55 pm

Doesn't matter anymore I've figured it out using the turret behavior thanks for the idea FassFlashconstructchris2013-09-07 15:58:37
B
8
S
2
Posts: 15
Reputation: 630


Return to How do I....?

Who is online

Users browsing this forum: Lordshiva1948 and 6 guests