Gravity Shift

I’ve been trying to implement the gravity change in my 3D game but I can’t think of a way to do it, like the “Gravity Rush” one, and i wonder if someone can give me an idea about how to make it, it would be very helpful

At the most basic level, you literally just change the gravity value:

If you want finer gravity control for individual objects, disable the built-in gravity (ie set it to zero) and then use rigidbody.AddForce to add your own gravitational acceleration to each object.

How can I get the force to be exerted towards where the character is looking?

You might want to study basic 3D math before tackling this, specifically vectors and possibly matrices.

In Unity, you can get a unit vector towards the “forward” direction of a transform using transform.forward. Or, if you want the direction from your character towards a specific point, just take the vector that goes from your character to that point and normalize it. Something like:

var dir = Vector3.Normalize(point.transform.position - character.transform.position);
1 Like