How to lock the Camera Rotation?

So, hi all…

Again, I’m having a trouble, I’m returning to use blender and I have forgotted a lot of basic things… so anyone can tell me how I lock the camera rotation in-game? It’s my current problem because I’m working on a ball game, but when I move the ball, the parented camera rotates with the ball…

Waiting for help!

I think you could place using python an empthy at the same position of the ball and parenting the camera to that empthy instead. So the camera would rotate with the empthy only, not the ball.

Okay, now I have parented the empty to the ball and parented the camera to the empty, so now the empty too rotates :frowning:

Use a vertex parent method. First of all, undo your parent by pressing Alt+P. I would recommend you to select the “undo parent but keep transform” or whatever it says so the camera wouldn’t return to it’s original position before parenting in case you’ve moved it while it was parented.

Now in edit mode you want to add a vertex at the center of the object you want the camera to be parented to. Once you do that, select the camera, then select the object that the camera would be parented to (which should have a vertex in it’s center), hit Tab to go into edit mode, select the vertex, then hit Ctrl+P to parent. It should ask you to apply a vertex parent. Select it, and there you go.

What the vertex parent does is it makes the child object (in your case the camera) follow the parent’s location without following it’s rotation.

If you do have any trouble or want to learn new tricks to enhance your game, please check out my blender full game tutorial series, where I actually show how to make a ball game, at this link:

best of luck!

Dhaher

Okay, now I have parented the empty to the ball

Note I didn’t said you would parent the empthy to the ball, please read more careful. I said you would position the empthy at the same position of the ball with python(obj.worldposition command).

This way you wouldn’t need to worry about vertex parenting for each game object you wanted to do that, thought if you do not want to learn python(in which case you will be also limitating your game potential) then just stick with all the vertex parent worries.

Finally it worked, thanks a lot! I can continue with my project! :smiley: