Scripting, Rotate and set gravity on collision

I am making a game where there is a ramp and as the player moves on the ramp the rotation and the gravity of all the objects in the scene change to that angle and as the player moves up the ramp the angle changes until it reaches 90 degrees PLEASE HELP looked everywhere cant find anything. here are before and after pics of what it should look like.

[9898-screen+shot+2013-04-09+at+6.11.11+pm.png|9898]

[9897-screen+shot+2013-04-09+at+6.12.52+pm.png|9897]

it is not scripted just placed the objects.
i have some knowledge of code but this is a tad to advanced for me please help it will be greatly appreciated.

1 Answer

1

Hi - you may still need assistance with the scripting (perhaps see collaboration section on the forums?) but essentially you should be able to update the orientation of your player at each frame by raycasting down at the surface your player is on and comparing the surface normal with the world orientation to perform a calculation and accordingly update the player orientation at every frame. This would allow for your objects to behave correctly with the new gravity orientation as your player moves up the ramp.