Annoying Pick Instance Problem

Get help using Construct 2

Post » Fri May 17, 2013 11:39 pm

Hello, would you take a look this .capx? use arrows to move, there are 2 layouts, one is correct and second is incorrect. I need to solve the second layout, just only 4 events.


https://dl.dropboxusercontent.com/u/76227787/pickproblem.capx

Would you help me? Thanks!Joannesalfa2013-05-17 23:40:17
B
97
S
35
G
29
Posts: 3,139
Reputation: 28,371

Post » Sat May 18, 2013 12:01 am

Try this:
ImageImageImage
B
71
S
21
G
230
Posts: 3,687
Reputation: 128,845

Post » Sat May 18, 2013 12:11 am

https://dl.dropboxusercontent.com/u/3954039/Temp/picksolution.capx

Well it's pretty simple why this happen. The pink sprites will only calculate the distance to the first instance of the blue object, because it can only store one value in the variable.

I added a "pick closest" condition, and a "for each Sprite" to solve this.
The "trigger once" was also causing a problem, so I removed it.

Edit: Ninja'ed7Soul2013-05-18 00:11:58
B
84
S
22
G
15
Posts: 1,039
Reputation: 15,249

Post » Sat May 18, 2013 3:23 pm

@blackhornet Thanks, sometimes i use trigger once to stabilize performance after all, so i removed trigger once to make it perfect. I would need to know more how to spawn another sprite once time.


@7Soul That's perfect, recently i got a new problem, If I implement spawn blue boxes from magenta sprites when they are touched, they generate more than once blue boxes could make terrible performance, otherwise i put trigger once, it only spawns one object, not twice or multiple times at once time.

How to fix it?Joannesalfa2013-05-18 15:23:39
B
97
S
35
G
29
Posts: 3,139
Reputation: 28,371


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 16 guests