Maze Rotation collision problem

I'm making a 3dcube maze in unity and I have a mesh collider & and rigidbody on the cube. I want to have the player be able to rotate the maze around the first person controller so they can run on the walls and ceiling.

*updated code the code I have for this is:

function FixedUpdate(){

if (Input.GetKey ("l")) transform.Rotate(Vector3.right * Time.time); if (Input.GetKey ("k")) transform.Rotate(Vector3.up * Time.time, Space.World); }

but for some reason the cube starts flickering when I try this and results in me falling through the cube or being flung out. any Ideas on how I could get this to work?

I was thinking the problem had something to do with the collider (from looking at other questions) so I tried making a compound collider but the same thing kept on happening when I tried to rotate the cube.

any help would be awesome...

  • Player Still drops out of the cube when rotating and falling; but hey no more flickering!:)

http://www.freeimagehosting.net/image.php?293b49eeeb.jpg http://www.freeimagehosting.net/image.php?8c04ad34be.jpg

Just looking at the bit of code you put up. you're rotating by increments of 2 degrees. I have a feeling that what you're trying to do is rotate smoothly and continuously over time, in which case you need to multiply your rotation value by Time.deltaTime. The scripting manual gives clear examples of this.