(S)How do I set physics object's gravity orientation

0 favourites
  • 7 posts
From the Asset Store
10 Beautiful Pokemon-like Building Pixel Art Sprite Sets
  • Hey, I want it when I press the up arrow to make the gravity be upward instead of downward, left arrow to make it go leftward and so on.

    How can I do this?

  • You can't change the angle of gravity with physics, other then setting world gravity for say 10 to -10 would do up and down but no left and right.

    This may help you though, it's setting impulse in the chose direction to simulate gravity.

    http://s000.tinyupload.com/?file_id=805 ... 2220495075

  • You can't change the angle of gravity with physics, other then setting world gravity for say 10 to -10 would do up and down but no left and right.

    This may help you though, it's setting impulse in the chose direction to simulate gravity.

    http://s000.tinyupload.com/?file_id=805 ... 2220495075

    This seems like a good solution, but is there a way to set a maximum on that force?

    Because right now it seems to be getting faster and faster as time goes on which is not quite how gravity works...

    Thanks!

  • You could try setting it so it only applys the impulse if the sprite is moving below a certain speed,

    Something like..

    [ sprite.physics.overallvelocity < 100 ] Apply impulse 1 at X angle

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You could try setting it so it only applys the impulse if the sprite is moving below a certain speed,

    Something like..

    [ sprite.physics.overallvelocity < 100 ] Apply impulse 1 at X angle

    There doesn't seem to be an overall velocity attribute...

  • and event, double click the sprite and under physics go compare velocity and then in the dropdown box there you can set to overall velocity, or whatever you may need.

    Sorry I suck at explaning things

    1am on a Saturday night my brain is...'elsewhere' xD

  • and event, double click the sprite and under physics go compare velocity and then in the dropdown box there you can set to overall velocity, or whatever you may need.

    Sorry I suck at explaning things

    1am on a Saturday night my brain is...'elsewhere' xD

    Great, thank you very much!

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