I'm making a game where you controll a ball, and roll it through a world. However, when I make my ball parent to the camera, the camera tumbles over whenever I roll. Is it possible to have the camera only rotate left an right when it follows the ball?

I'm making a game where you controll a ball, and roll it through a world. However, when I make my ball parent to the camera, the camera tumbles over whenever I roll. Is it possible to have the camera only rotate left an right when it follows the ball?

Thanks in advance,

Segia

You will have to write a python script to just take the position of the object you want the camera to follow and set the position of the camera based on that. This is how i used to do it.

Well that being said I'm obviously a noob but I would like to see if this code will work with what I have planned...

With the same circumstance ie. object spinning... could I have the physics turn the model - Have the camera pivatable (will try out another thread, or if you could help out also) and fixated on the ball

I would just like to know if that code would still work, as I have no clue about python and am not sure how hard it is to find out how to use it...

I'll tell you what I've tried and what would happen...

First off I tried what the poster said and just parented it, but because I switched from using only force to using a spin animation with the force and it spun the camera. Then I started finding out which motion variable I should use, so I switched between force, torque, and angular velocity, so far the torque+force works best for what I want to accomplish but how it works normally is kinda whacked out ie. after you move forward its fine, then you move sideways its fine but then you move forward or backwards its axis is messed... In other words you try and go forward and it spins, or is off axis and rolls away...

So my solution to that was to try and make an empty the parent of the sphere and have the sphere follow the empty, that way I can have all forces needed for movement ie. 8 way movement (Ang. V. spins the ball but not diagonaly). Now also I want the camera to pivot on the sphere through keyboard comands (easy to do but the spinning camera is... wack...) Now I don't know enough about blender to know if you could attach armatures, or something else to do what I want... Basicaly I want to make a ball that can move around a world... Everything else I will just experiment with and take my time to tweak and w.e but this is major, and it is to hard to "wing it" as I don't know what needs to be scripted or not... If you know or have any codes on hand it will help, but otherwise I would just like to know what I can use blender for and what I need to learn python for (I have NO quams over learning some python so no worries)... Also If you could quickly tell me how each part of the code is needed for what (just so I can understand better without asking a crap load of questions)

Well It was a long one but I hope some people can help me out here, maybe even help others starting out.

Back to the original question, how to make the camera follow the ball, I once came across a game on BlenderArtists called Open Marble 1 by Jacob Baldwin. He had a dynamic empty with the logic on it (the logic made it move in directions, not rotate) but a ridged body ball that had a ball constraint to the empty. The camera was just parented to the empty. No python required.
Good luck!