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

Get help using Construct 2

### » Sat Apr 29, 2017 5:51 pm

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?
Last edited by TRMG on Tue May 23, 2017 9:01 am, edited 1 time in total.
B
32
S
9
G
7
Posts: 274
Reputation: 5,725

### » Sat Apr 29, 2017 8:18 pm

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.

B
22
S
6
G
2
Posts: 30
Reputation: 1,879

### » Sat Apr 29, 2017 8:56 pm

higher2003 wrote: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.

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!
B
32
S
9
G
7
Posts: 274
Reputation: 5,725

### » Sat Apr 29, 2017 10:28 pm

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
B
22
S
6
G
2
Posts: 30
Reputation: 1,879

### » Sat Apr 29, 2017 11:13 pm

higher2003 wrote: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...
B
32
S
9
G
7
Posts: 274
Reputation: 5,725

### » Sun Apr 30, 2017 12:05 am

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
B
22
S
6
G
2
Posts: 30
Reputation: 1,879

### » Sun Apr 30, 2017 12:02 pm

higher2003 wrote: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!
B
32
S
9
G
7
Posts: 274
Reputation: 5,725