How do I change the size of an object in a loop?

Get help using Construct 2

Post » Thu Jun 16, 2016 11:10 pm

because this : http://prntscr.com/bhbho5 apparently doesnt work. It never changes its width...
B
12
S
3
Posts: 211
Reputation: 1,477

Post » Fri Jun 17, 2016 12:24 am

That should work, unless you have some other event or action that's setting the width to something else... in your loop though, every object would be resized to the same size - since it would be picking every instance of that object and resizing it (so maybe it is working but they're all the same size and probably overlapping?)

You will need to add a way to only allow the resizing to work once per object - so you can have a boolean instance variable that changes to on or off (whatever your preference) and add that condition as a sub event to your loop and move the resize action to that sub event - and make sure you trigger the boolean change after you resize so it doesn't resize each time the loop is run.

Hopefully that makes sense.

~Sol
Tired of crappy file hosts that are crappy? Get DROPBOX - https://db.tt/uwjysXJF
Moderator
B
83
S
34
G
40
Posts: 3,032
Reputation: 30,474

Post » Fri Jun 17, 2016 12:33 am

The problem is, after the wait, loopindex will be zero again, since it's out of context. You could use the Timer behaviour to do this instead.
ImageImageImage
B
71
S
21
G
233
Posts: 3,697
Reputation: 130,370

Post » Fri Jun 17, 2016 10:28 am

thanks for the input. I fixed it by using a temp variable, increasing it in the loop and setting the new width to temp.
B
12
S
3
Posts: 211
Reputation: 1,477


Return to How do I....?

Who is online

Users browsing this forum: amazingdream and 25 guests