Rolling ball problems

Hello i am making a game where you are rolling a ball though a maze and collect coins the get to the finish.
i have the camera following the ball correctly using vertex parenting.
so the ball rolls and the camera follows but stays at its own rotation.
my problem is that i want to be able to rotate the camara around the ball so you can look at the world from more then one angle.
i have it set up so that when i press the up arrow the ball rolls in the global +X direction
but when i rotate the camara to the left 90 deg. and press the up arrow to roll the ball.
the ball keeps rolling in the global +x direction.
i know why this is happining.
i would like it so that when i rotate the camera to the left 90 deg and press up
the ball will go forward from my point of veiw.or roll left form my poin of veiw if i press left. etc.
i have not been able to find a forum post on this subject.
any help
PS i bet i will probaly need to use python and i am not familear with the blender commands.

You do need python. Search for “orientation matrix”. With that, you can get the direction the camera is facing, and then apply force to the ball depending on that.

my problem is how do i turn the matrix from that into torque on the ball in the proper direction

This has been brought up before and I was going to point you to this thread that used complexed matrix math(140 line of python).
but it doesn’t even work that great and I’ve always thought there must be an easier way.
but could never get it to work.

Until now! I just got it working! Its so simple I cant believe no ones done it before
(no one as for as I know)

No python, no parenting.
Just two objects, one Rigid Body ball joint Constraint, and DYN material friction.


physics_ball_camera_control_01.blend (161 KB)

Nicely done! That’s one of the simplest ways to do that I’ve seen.

that fixed my problem perfectly.
the only down side is that if you have the camera tilted at all so it looks up or down on the ball it will mess up the movement (you can have it tilted a bit without to much though)
and that the phisix are not as realistic as a simple rigid body with torque for movement

i posted my game here