Setting variables take place out of order?

Get help using Construct 2

Post » Sun Feb 21, 2016 2:53 am

Player gravity is 2000

Trigger on button:
Set instance variable to Player.Platform.Gravity
Change Player gravity to 300

On button release:
Change player gravity to Player.instanceVariable


Why does instance variable get change to 300 instead of 2000?

Checked in debugger and instance variable is 300. Why does this seemingly go out of order? I would think that it would be set to 2000.
ImageImageImage
B
39
S
22
G
11
Posts: 486
Reputation: 9,913

Post » Sun Feb 21, 2016 3:14 am

It should work as you expect if "on button" and "on button released" refer to the same button. I can't tell without seeing the actual events though.
B
91
S
31
G
103
Posts: 5,235
Reputation: 67,756

Post » Sun Feb 21, 2016 8:57 pm

Solved

Didn't realized I used "while key down" instead of "on key pressed" so it was constantly running (and replacing the variable more than once). Changing to "on key pressed" or adding "trigger once" both solved.

Sorry and thanks.
ImageImageImage
B
39
S
22
G
11
Posts: 486
Reputation: 9,913


Return to How do I....?

Who is online

Users browsing this forum: newt and 10 guests