[Solved]Duplicate Enemy, keep variables separated

Get help using Construct 2

Post » Fri Dec 06, 2013 12:03 am

Hey there,
I have an enemy, with the variables:
Range (when within range, enemy follows player)
Attackrange (when within range, enemy stops moving and attacks)
Attacking   
MoveTowards

Well when I duplicate this enemy, the others do attack when they're not even in range. So how can I seperate these variables, so every Enemy does his own thing?
Heres a screenshot:

Derqs2013-12-06 01:00:58
B
8
S
4
Posts: 120
Reputation: 1,266

Post » Fri Dec 06, 2013 12:14 am

Ha, this used to drive me nuts. Being an professional programmer I felt frustrated and dumb that I could not figure out such a simple thing on my own. I ended up quitting Construct 2 for a year. :P
B
11
S
2
Posts: 68
Reputation: 982

Post » Fri Dec 06, 2013 12:26 am

Using For Each will probably clear this up, to ensure each enemy is being evaluated separately.
ImageImageImage
B
71
S
22
G
247
Posts: 3,756
Reputation: 137,558

Post » Fri Dec 06, 2013 12:59 am

Thanks! I looked up For Each in the manual. (it's in 7.1)
B
11
S
2
Posts: 68
Reputation: 982

Post » Fri Dec 06, 2013 12:59 am

Thanks, for the quick help! @blackhornet it works like a charm.
They now move independently of each other
B
8
S
4
Posts: 120
Reputation: 1,266

Post » Tue Feb 11, 2014 10:54 am

Hey I am having the same problem like you did.... If the player comes near one enemy all the other enemies also start to shoot ... could you please help me how I can solve this problem ...

I did go through manual 7.1 but don't understand what i have to do ..

Thank you,

Rafael0125
B
8
S
1
Posts: 37
Reputation: 593

Post » Tue Feb 11, 2014 12:44 pm

Finally I understood .. FOR EACH ... u this post really saved me from such a big prob ...
B
8
S
1
Posts: 37
Reputation: 593


Return to How do I....?

Who is online

Users browsing this forum: Yahoo [Bot] and 62 guests