How do I change gravity angle

Get help using Construct 2

Post » Wed Apr 16, 2014 5:55 pm

Hello.

I want to rotate the world and I need to to change the gravity angle. How to do this? I did not find any property or function to change the angle of gravity. I only found a force of gravity :(

When I try to rotate the box (see example) it looks unnatural. See the video: http://youtu.be/b4hUTYOjajU

Example: http://yadi.sk/d/U1_AOg57MbJ2v

Please add an angle of gravity.
B
5
S
1
Posts: 29
Reputation: 718

Post » Wed Apr 16, 2014 9:28 pm

Are you using physics behavior?

1st off, you need to create a family (you can call it physics objects or whatever). Add any objects that will be affected by gravity. Add physics behavior to the family and set it up for however you want the defaults to be. In my projects I have a group that is called initialization I have it at the top of my event list and at the end of the group I have a turn group off action. Everything in this group will run only once and then never again unless reactivated. In this I select a physics object and set the global physics setting gravity to 0.

Then, somewhere in your event list you need an action that applies the force of gravity to your objects at whatever angle you need gravity to be at that moment. It looks like this:

every tick -> family.physicsObjects apply force (objects mass * desired speed*dt) at angle (This would be the angle of gravity (down is 90)).

This is the way I do it and it works nicely.
Image
B
33
S
11
G
2
Posts: 564
Reputation: 5,153

Post » Wed Apr 16, 2014 9:30 pm

on a side note.... only use dt if you have your physics set to frame-rate independent mode (also found in the global settings of a physics object)
Image
B
33
S
11
G
2
Posts: 564
Reputation: 5,153

Post » Thu Apr 17, 2014 3:44 pm

Thanks a lot. It's a great way! But I can't understand what is dt?
B
5
S
1
Posts: 29
Reputation: 718

Post » Thu Apr 17, 2014 3:55 pm

composer - multimedia artist
www.eli0s.com/en/
B
69
S
27
G
6
Posts: 1,146
Reputation: 10,379


Return to How do I....?

Who is online

Users browsing this forum: dop2000, Jackriduk, NN81 and 37 guests