How does this filter apply?

Get help using Construct 2

Post » Wed Nov 04, 2015 10:14 pm

Message: Santhenar can only post plain text URLS until they have 500 rep. 1 URLS modified. Why?
I have a condition which is

Sprite width < 5

Destroy sprite.

(Wanted a screenshot, but imgur is down)
Surely this should only destroy sprites whose width is less than 5 pixels, but when the width of one sprite drops below 5, it destroys 80% of the sprites.

Here's a capx if you like:

https://www.dropbox.com/s/
vc3geyox3dqpmt0/line3.capx?dl=0
B
5
Posts: 85
Reputation: 395

Post » Wed Nov 04, 2015 10:54 pm

That condition is working correctly. You're picking the nearest line and setting it's width to the distance between the player and a node. The issue is finder.node is updated a few frames later so the width calculation will be the same and every frame the next closest line is destroyed.

To fix it you'll need to synchronize destroying lines when you change nodes. A simple way would be to give the lines a variable with it's node number, then in the "step=finder.noSteps" event add a sub-event that picks the line with the old node number and destroy it there.
B
92
S
32
G
109
Posts: 5,294
Reputation: 70,999

Post » Thu Nov 05, 2015 1:40 am

@R0j0hound

Thanks!
Sounds like a plan!
B
5
Posts: 85
Reputation: 395

Post » Thu Nov 05, 2015 1:50 am

@R0j0hound

Worked a charm!
B
5
Posts: 85
Reputation: 395


Return to How do I....?

Who is online

Users browsing this forum: khelaghor and 31 guests