I have just started working on using the game engine. I have created a sphere that can move. but I want the camera to be able to rotate and zoom on the ball. I cant figure out how to make the camera rotate around the ball and not around the axis or the camera’s center.
for zoom in: just copie this file… very easy
(scroll to zoom)
When I make the empty parent to the ball it wants to rotate with the ball making the camera rotate with it. I don’t know how to fix this.
Follow this tutorial:
It will answer your question. However, the camera will not rotate by itself. The player will have to rotate it manually. I haven’t figured out a way around this yet.
that is not what I meant, I want to be able to rotate the camera around the ball using arrow keys. and follow the ball at the same time
Yes, it is what you meant. You’re just not applying the knowledge that you already have.
- Add an empty at the center of the ball.
- Vertex parent the empty to the ball. (This is what my tutorial teaches you)
- Parent the camera to the empty by the normal parenting method.
- Set up the empty to rotate with the arrow keys.
This should work. If it doesn’t, it is because of a bug related to vertex parenting, not because the method is wrong. Let me know if it does not work.
ok so far so good
i can rotate up and down no problem, but when I rotate left and right I must be in a view parallel to the plain that the ball is siting on in order to get the camera to rotate staying at the same hight above the plain.
I hope this makes sense. and I hope you have an answer
@blendenzo- very cool, I didn’t know there was such as thing as vertex parenting, thanks for sharing.
if the vertex parenting doesn’t work (for some reason, i dont know) we could just use a simple python script that’s what I usually do before I heard of vertex parenting, the python would be:
this will copy the position but not the rotation… I’ve used it before…