How do I add gravity?

Get help using Construct 2

Post » Sat Aug 29, 2015 8:30 pm

I am fixing to add gravity to my player object so OnJump(), the player moves up then comes back down.
web worker
B
18
S
3
Posts: 7
Reputation: 1,528

Post » Sat Aug 29, 2015 10:14 pm

If you have a platform behavior attached this should be already apart of the custom values part.

<. < If this is a question for you I would highly recommend you check out the construct 2 Manual
B
23
S
8
Posts: 115
Reputation: 2,640

Post » Sun Aug 30, 2015 7:22 pm

Hey taser, thanks for your response. Yep, I have consulted the manual but it does not document how to implement the gravity feature
web worker
B
18
S
3
Posts: 7
Reputation: 1,528

Post » Sun Aug 30, 2015 8:31 pm

@ij3m

Like Taser said, gravity is already build in to the Platform behavior. You can change its value in the properties panel, or at run time (if you want stronger or lighter gravity, you can also change the Angle of Gravity). The default value is 1500. As long as there is a value for gravity, everything will happen automatically. There is no need to do anything in the OnJump() event (other than change animations, or things along those lines).
B
95
S
33
G
20
Posts: 438
Reputation: 17,640

Post » Mon Aug 31, 2015 6:31 am

gee thanks, I will post an update.

<!--UPDATE-->
Having added the gravity, my player falls off the screen!
web worker
B
18
S
3
Posts: 7
Reputation: 1,528

Post » Tue Sep 01, 2015 7:22 pm

ij3m wrote:gee thanks, I will post an update.

<!--UPDATE-->
Having added the gravity, my player falls off the screen!


Add a psychics behavior to the object you want to stand on and make it immovable.
B
23
S
8
Posts: 115
Reputation: 2,640


Return to How do I....?

Who is online

Users browsing this forum: evillair and 11 guests