Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / Gravity not working?

Author
Message
Raizzan
9
Years of Service
User Offline
Joined: 28th Jan 2015
Location:
Posted: 24th Dec 2015 12:33 Edited at: 24th Dec 2015 12:54
Well hello again!

Im trying to make an jump&run game - and i want to let my player-character jump.
Everything seems to work fine, but it feels like the character is on the moon and floating around instead of falling.

so i try to make more gravity and set:

SetPhysicsGravity( 0, 1000 ) (same)
it seems a bit better- but still, the gravity is very moonish
so i did:
SetPhysicsGravity( 0, 2000 ) (same)
so i did:
SetPhysicsGravity( 0, 10000) (same)
SetPhysicsGravity( 0, 10000000 )(same)
it almost seems like the gravity is capped somewhere between 1000 and 2000.
SetPhysicsGravity( 0, 10) (very low gravity)
^Works the gravity is low


i even turned the damping restituion and even friction off, same results.....

SetSpritePhysicsFriction(sprID, 0 ) //no friction
SetSpritePhysicsRestitution(sprID, 0 ) //no bounce
SetSpritePhysicsDamping( sprID, 0 ) //no airresistance


now my question:

what am i doing wrong?
CJB
Valued Member
20
Years of Service
User Offline
Joined: 10th Feb 2004
Location: Essex, UK
Posted: 24th Dec 2015 12:51
Without seeing your code, my guess would be your scale is off. Try changing it with setphysicsscale.

Default value is 0.2, so try setphysicsscale(0.4) to see if that makes any difference.
This function must be called before any other physics functions, and must not be called once the physics system is running.
V2 T1 (Mostly)
Phone Tap!
Uzmadesign
Raizzan
9
Years of Service
User Offline
Joined: 28th Jan 2015
Location:
Posted: 24th Dec 2015 12:56

Heyyy!!

Yes it worked man!
Thanks a lot!

mrradd
9
Years of Service
User Offline
Joined: 24th Feb 2015
Location: CA, USA
Posted: 27th Dec 2015 00:00
Quote: "Without seeing your code, my guess would be your scale is off. Try changing it with setphysicsscale.

Default value is 0.2, so try setphysicsscale(0.4) to see if that makes any difference.
This function must be called before any other physics functions, and must not be called once the physics system is running. "


I never considered scale before. I always just changed the physics step to .2 or something. How does scale work as appose to physics stepping?
-mrradd-

Login to post a reply

Server time is: 2024-09-29 09:15:50
Your offset time is: 2024-09-29 09:15:50