How do I change the gravity of an object ?

Get help using Construct 2

Post » Sat Oct 24, 2015 8:17 pm

Hi! I've just began creating this game where a platform character (a leaf) is falling in a vertical scroll and you have to avoid every obstacle (branchs and waterdrops).

What I want to do is to increase the leaf gravity everytime a waterdrop hits it.

I tried creating a variable : " Gravity = 30 " (Which is the starting gravity the leaf has).
Then I wrote that the variable Gravity is set to Leaf.Platform.Gravity
Everytime a waterdrop hits a leaf (by hitbox) Gravity is increased by 30 (for example), however when I'm playing I doesn't work.

Thanks for the help, I'm still a newbie with C2.
B
4
Posts: 14
Reputation: 230

Post » Sat Oct 24, 2015 8:56 pm

You have also to increase the 'Max fall speed' . The gravity in the Platform-Behavior is only the acceleration. If your leaf has reached the 'Max fall speed' increasing the gravity will do nothing.

One hint, if you set the gravity negative your leaf will float up. Maybe you can use that for a gust or something like that.
B
24
S
3
G
1
Posts: 451
Reputation: 2,165


Return to How do I....?

Who is online

Users browsing this forum: alextro, Ryan Kocourek, Yahoo [Bot] and 7 guests