I have a ball, that has been moved via addForce. It colides in the scene with objects, leading to rotation in all axes.
I want a camera to follow this ball but from the side (direction ortogonal to the move vector and UP vector). No matter what I do, I cannot get this working. The closest I get is almost correct, but camera "bumps" during frames.
I have used this in camera script to attach camera to the ball and move it with it:
this.transform.LookAt(this.cannonBall.transform.position, Vector3.up);
this.transform.position = ball.transform.position;
No I need to rotate camera 90 degree aroun up axis and move it a little backward to track ball from the side.
How can I achive this? If I use
this.transform.Rotate(Vector3.up, 90, Space.World);
It mess up lookAt