[Solved] "Set Gravity = 0" doesn't seem to work

0 favourites
  • 11 posts
From the Asset Store
_______ Huge collection of metal fixtures ________
  • I have a top-down tilemap with a sprite. I need physics to apply a force on certain controls. I can do all of this fine, however "set gravity = 0" on the sprite is not working. The sprite simply drops to the bottom of the screen. Other "set gravity = 0" what else must I set?

    Thank you, thank you, thank you for your help

  • If you set gravity to 0 after applying force I think the object will keep it's movement. Try to stop the object's movement where it is and then set gravity to 0. However I don't know if it will work and also I don't know what's the goal.

  • Set gravity = 0 works for me. But you must zero both X and Y vectors if the object is already moving.

  • You need Vector Y to be zero.

    Read on Platform behavior in manual. Unless you disable the platform behavior itself, it will still free fall even if gravity = 0.

    https://www.scirra.com/manual/100/platform

    read on

    Set enabled

    Set ignoring input

  • I've tried setting the x/y vectors to zero both before and after setting gravity to zero. In both/either case, the ball drops to the bottom of the screen.

    See attached screen clip...

    https://www.dropbox.com/s/ovek2apd4874eb5/Construct2_Event_Layout_Start.PNG?dl=0

    Thanks again for your advice and help

  • If you set gravity to 0 after applying force I think the object will keep it's movement. Try to stop the object's movement where it is and then set gravity to 0. However I don't know if it will work and also I don't know what's the goal.

    The goal is to create "top down view" of the tilemap. The default gravity is not "top down view" its a side view for platformer games. I've read in numerous articles and posts that state you simply set gravity to zero in the layout start event. I'm doing this, in addition to setting the ball x and y velocity to zero and the ball still drops to the bottom of the screen. There is some other setting somewhere that I'm missing.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You need Vector Y to be zero.

    Read on Platform behavior in manual. Unless you disable the platform behavior itself, it will still free fall even if gravity = 0.

    https://www.scirra.com/manual/100/platform

    read on

    Set enabled

    Set ignoring input

    How can I "disable the platform behavior itself"? Do I not use "Physics"? Use some other "Movement" setting?

    Thanks <img src="{SMILIES_PATH}/icon_e_smile.gif" alt=":)" title="Smile">

  • I'm trying "Car Movement" behavior on the ball instead of "Physics" behavior which defaults to a side-view platformer game world. Not sure if this is the right way to go or not. Lets see what happens...

  • I'm trying "Car Movement" behavior on the ball instead of "Physics" behavior which defaults to a side-view platformer game world. Not sure if this is the right way to go or not. Lets see what happens...

    Dropping Physics behavior and using Car or 8Direction movement eliminates the Platformer gravity that drops the ball to bottom of screen. I can rotate to different angles and change acceleration, so that's something positive I suppose. However Car/8Dir are not the right movement physics for a ball rolling on a flat (top-down) surface. It doesn't move correctly.

  • No need to set gravity to zero. If you do not wish to let your ball fall down then do this

    On start of Layout = sprite set physic disabled

  • I had the code that set gravity to zero (and every other code fix I was trying for the last couple hours) in another event sheet that was not included in the layout's event sheet.

    It's now working just fine. Thank you everyone for your help.

    I apologize for being a bit of dolt

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