Multi-plane gravity editing

I'm quite new to Unity3D but I know my way around it by now. I'm trying to create a character controller that will allow me to change the orientation of gravity and the player so that I can allow movement on all interior or exterior sides of a cube.

Similar to the indie game VVVVV but in 3D, allowing gravity to not only be inverted but also be transformed to enable wall-walking.

I really have no idea where to start with this. Could anyone offer any suggestions? Should I edit the FPS character controller prefab's scripts or write my own?

For physics objects, You can set `Physics.gravity` to change the gravity acceleration vector at runtime. (To do it in the editor, Edit->Project Settings->Physics.) Or, if you want special gravity for a particular object, uncheck "Use Gravity" from its Rigid Body component, then give it a behavior that calls `rigidbody.AddForce()` in its `FixedUpdate` method.

As for the character controller, that's going to be somewhat more difficult, as "which way is up" is hardcoded into the premade character controller scripts in a few places. I think it would probably be simpler to start from scratch, particularly since the design of the character controller has a few assumptions which don't work if gravity can change.

As a completely off the wall alternative, how 'bout this: Have everything in the world (including the camera, for a third-person game) be a child of a single GameObject. To "change gravity", rotate that gameobject, then rotate the character's localRotation by the opposite rotation.

I haven't used the character controller much, but this question seems like it might be relevant. Also, you might be interested in the article on Mario Galaxy that Gamasutra ran a while back.

From what I understand, you essentially find the closest surface to your character, get it's normal, and ta-da - you've got your orientation and gravity direction.

Now, as to writing the code to change world gravity...that's something a little more in depth and I'm not sure what the best way would be for it.

Hope this was of some help, though!

EDIT: Looks like there's a variable in the physics manager that you can get at. See this thread: http://answers.unity3d.com/questions/22048/gravity-and-the-physics-manager