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
96
S
25
G
20
Posts: 3,055
Reputation: 22,644

Post » Sat May 18, 2013 12:01 am

Try this:
ImageImageImage
B
67
S
19
G
124
Posts: 3,215
Reputation: 74,417

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
83
S
21
G
15
Posts: 1,039
Reputation: 15,134

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
96
S
25
G
20
Posts: 3,055
Reputation: 22,644


Return to How do I....?

Who is online

Users browsing this forum: GSquadron, Yahoo [Bot] and 26 guests