How do I set the angle of gravity for physics

Just started using Construct 2? Post your questions here

Post » Thu Jan 08, 2015 2:20 am

I have a switch the player can press to change the angle of the layout, player/player sprites and angle of gravity for the player platform. The object with physics that the player can 'shoot' out seems like it can not be changed and will always adhere to a default angle of gravity. Is there any way to change the angle of gravity for objects with the 'physics' behavior?

Thank you.
B
10
S
2
G
2
Posts: 87
Reputation: 1,274

Post » Thu Jan 08, 2015 3:10 am

If you're using the physics behavior you can't actually change the angle of gravity, but you can replace gravity altogether. If you wouldn't mind it, you can actually change gravity to either an impulse or force acting upon the object and use a variable as it's angle. So whenever the player triggers the switch, the impulse/force angle will adjust according to that.
You can then change the angle of the sprite to the variable you used for the angle of physics.
ImageImage
B
49
S
15
G
2
Posts: 270
Reputation: 6,649

Post » Fri Jan 09, 2015 2:02 am

Thanks KTML5!

I've played around with physics some more and will leave it to a future endeavor for now. I'll keep the information you provided me saved for when I delve into physics again. : )
B
10
S
2
G
2
Posts: 87
Reputation: 1,274


Return to Beginner's Questions

Who is online

Users browsing this forum: No registered users and 2 guests