Hi everyone ,
I recently started working on a FPS with shifting gravity (I’m basically trying to obtain something like this : http://www.meridian.net.au/Art/Artists/MCEscher/Gallery/Images/escher-relativity-woodcut-medium.jpg, where you can walk on nearly every wall). After a lot of research and scripting, I finally managed to end up with what I wanted, but there are still some things to improve. I just recently added the mouselook script, but there are some problems when the gravity shifts.
A quick presentation of the game :
As you can see in the picture, the gravity is normal at the beginning (z- axis). When the player walks to the wall on the left, the gravity switches to the x- axis, and the wall becomes the floor. If the player goes forward again, the gravity switches to the z+ axis, and he ends up upside down.
The movement script works fine with the gravity switching : for example, in the “x- zone”, the W key still makes the player go forward (only it’s along the z axis, not the x axis like in the “z- zone”). This is because the player rotates so that his feet (well, it’s more of an octagonal base here) always face downwards in comparison with the gravity.
My problem is that it doesn’t seem to work the same with the mouselook script : when I move the mouse in the “x- zone”, the camera rotates along the global y and z axis, so I can’t look to the left or the right, and when I enter the “z+ zone”, the controls are inverted along the global z axis (moving the mouse left makes the camera rotate right).
I tried to look at the script but it is quite complicated and I couldn’t locate the problem, so I hope someone out there has an answer (I’ve been using this mouselook script : http://riyuzakisan.weebly.com/mousemove-script.html#download)
And if anyone knows how to do stairs that I can climb like in the first picture, it would also help me a lot. I tried to create a 45° angled plane but the player keeps sliding down because of the gravity, so I guess it has something to do with friction.
Any kind of help is appreciated