How do I change the gravity of an object ?

  • 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.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • 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.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)