Need help with Multiple Instances

Get help using Construct 2

Post » Mon Nov 18, 2013 4:16 am

Hi everyone,

I have 2 issues here and I don't find any solution. Even by using UID.
I have 2 enemies that are the same sprite.
They have Line of Sight, Path finding and solid behavior.

When the Player is in Line of Sight Range of one of the sprites, the sprite who detects the Player moves. When the distance between Sprite and Player is <40, Enemy sprite stops and plays "Attack"animation.

This behavior works for the original sprite but not for the instance

Each sprite detects the Player normally and behaves correctly except for attacking

As you can see the picture below.

At the bottom, the original sprite works.
At the top of the pic, you can see that the instance overlaps the Player and does not perform his attack.
In the middle, if the original sprite reached the Player and then the instance reached the Player, both sprites play their "Attack" animation but they overlap the Player instead of stop at 40 from the Player.




Do you notice anything wrong on the capx?

In addition, I would like to have both sprites surround the Player instead of overlapping each other. Is there a way to say, if Player left side is occupied by an enemy, search other side (right/top/bottom)
If the four sides are occupied, stay at X from Player and check if one side becomes free?

ThanksUnderdog2013-11-18 04:25:03
B
26
S
10
G
3
Posts: 72
Reputation: 4,008

Post » Mon Nov 18, 2013 4:45 am

https://www.dropbox.com/s/lpmh7rp7r9h1ctt/MultipleEnemies.jpg

Do you see the pic?
B
26
S
10
G
3
Posts: 72
Reputation: 4,008

Post » Mon Nov 18, 2013 5:12 am

I resolved it :)
I needed to pick instances by evaluating distance.

B
26
S
10
G
3
Posts: 72
Reputation: 4,008


Return to How do I....?

Who is online

Users browsing this forum: dop2000, ultrafop and 12 guests