I am creating a 3D game where the player can push a button, and “position” of gravity will be shifted. To make it any clearer, if I press T in the game, all objects and including the character will move upwards because gravity has been re-positioned so that the ceiling is now the new floor or the level. Same thing with the walls. This is what I have been using so far but it isn’t workng:
private void Start()
{
...
Physics.gravity = new Vector3(0, -1.0f, 0);
}
private void InputManager()
{
if (Input.GetKeyDown("T"))
{
Physics.gravity = new Vector3(0, 1.0f, 0);
}
}
Is there another function I should be using or is the solution more complicated than this? The camera isn’t an issue by the way.