Walking Around A Cube.

Hi guys, Griga again for another noob question.

To go further into my project, (an interactive Rubiks Cube with a 3rd person controller on it), i need to change the gravity as my character go into different faces. Mario Galaxy is the perfect example to illustrate what i mean.
My character will just fall off the cube as i reach a border, but what i need is him to walk around it, being attracted by the face he currently is on.
I have no clue how to do this, any advice would be appreciated :slight_smile:
Thanks !

One solution, is to position a BoxCollider at each face of the cube. Make this a trigger. When the player enters the trigger, you can adjust gravity, through your script, to be in any direction you wish.

If the rubiks cube is able to rotate, it will be more difficult than just setting gravity from y=-9.8, to x= -9.8, etc. But it can be done.

You will need to get Normal (perpendicular) vector to the plane you wish to be attracted to. And set gravity to the opposite of the Normal direction.

You would also have to position your players orientation to tat same Normal vector (perpendicular to the plane).

Is this all to generic?

Griga, Did you ever figure out the best way to do this? I am working on a similar task trying to get a character to walk around a Rubiks style cube and would love to see what your solution was. Thanks.

Hello, did you manage to position the character on each side of the cube without falling ? If so, how did you do it ?