Quantcast
Channel: Questions in topic: "ios"
Viewing all articles
Browse latest Browse all 4709

Changing Gravity Quickly?

$
0
0
Hi, all! I'm experimenting with my very first iOS game, and it is going nicely. Currently, the player falls, and the gravity on the X axis is controlled by the tilt of the phone. However, when the user tilts the phone in the opposite direction of the current gravity, it takes a long while to get the gravity to reverse. Is there a way that I can get the gravity acting on the cube to change more quickly? (I would love to be able to control how responsive it is) Maybe a way to just reset the rigid body? Current code: public float force; void FixedUpdate () { Physics.gravity = new Vector3( Input.acceleration.x*force, -9.81f, 0 ); } Thanks! - YA

Viewing all articles
Browse latest Browse all 4709

Trending Articles