How do I change the direction of gravity?

Just started using Construct 2? Post your questions here

Post » Wed Jul 20, 2016 1:40 pm

I know that, by default, the direction of gravity is down along the Y axis. I also know that I can change gravity's direction to up, by entering a negative value (e.g., -10). What I'd like to know is can the direction of gravity be set to either right or left along the X axis?
If the answer is no and that I should use Force instead, what would the equation be to mimic the force of gravity? Thank you.
B
5
Posts: 11
Reputation: 247

Post » Wed Jul 20, 2016 3:20 pm

I'm not sure if it works, but does rotating the layout affect gravity?
Mistakes were made.
B
54
S
28
G
115
Posts: 1,705
Reputation: 65,083

Post » Fri Jul 22, 2016 1:09 am

For Platform behavior objects you can change the angle of gravity using events. Sounds like you are using physics behaviors. I would just set gravity to zero and constantly apply a force to simulate gravity.
ImageImageImage
B
44
S
26
G
11
Posts: 518
Reputation: 10,502

Post » Fri Jul 22, 2016 10:25 am

It is possible with physics too. But you need a plugin.

@rexrainbow 's rex_physics_gravitation plugin
behavior-gravitation-for-physics-behavior_t70521

Here is an example. All objects are draggeble. The (bad drawn) planets are gravity sources, so in fact they are the position the gravity works towards. That is the same as defining an angle. You can even have more then one gravity source.

https://drive.google.com/open?id=0B1SSu ... GJ2eUhxVnc
B
33
S
18
G
28
Posts: 2,493
Reputation: 20,950

Post » Fri Jul 22, 2016 12:44 pm

I asked for this a while back: viewtopic.php?f=146&t=126014
ImageImageImage
B
71
S
22
G
257
Posts: 3,788
Reputation: 142,692

Post » Fri Jul 22, 2016 2:14 pm

Thanks everyone. I'll dig deeper and post what I learn.
B
5
Posts: 11
Reputation: 247


Return to Beginner's Questions

Who is online

Users browsing this forum: No registered users and 0 guests