Reset Gravity?

For questions about using Classic.

Post » Fri Nov 02, 2012 6:37 pm

I'd like to know if it's possible to reset Fall Gravity's strength (Platform Behavior) in mid-air.

I have a dash ability in my game that shoots the player forward by X pixels along a straight line, that can be used either on the ground or in mid-air. So the player is able to jump, and then dash during the jump, to cover larger distances.

The issue I have is that when the Dash ability is used when the player is falling, he is shot forwards horizontally (by disabling the platform behaviour), but then the gravity strength resumes where it left off when the dash is completed and the platform behavior is re-enabled. It looks wrong, as though the player is being dragged down far too fast.

I have tried setting the gravity strength to 0 once the Dash is completed, using the Wait command, and then setting it back to 1500 again, but that doesn't work. The gravity resumes at full strength instead of slowly building up.

Does anyone have any ideas? Thanks for reading
B
15
S
7
G
7
Posts: 250
Reputation: 5,298

Post » Fri Nov 02, 2012 10:14 pm

If you disable the behavior all parameters are pending. They stay at their last value. Instead of setting the gravity strength to 0, you could try to change the state of the player object by changing its components of motion (probably to 0, found as actions under the movement tag). But I didn't test this.
Image
B
23
S
8
G
10
Posts: 1,820
Reputation: 8,242

Post » Mon Nov 05, 2012 8:41 am

I love you so much. It works perfectly
B
15
S
7
G
7
Posts: 250
Reputation: 5,298


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 2 guests