1
\$\begingroup\$

I am facing issue when camera is following to my target and target rotates to 90 degree or -90 degree than camera is not rotating.i want smooth rotation according to target when target is change the direction of movement.please help me if you can..thanks in advance.

\$\endgroup\$
  • 1
    \$\begingroup\$ Had put camera as child of target? maybe we need more details.. \$\endgroup\$ – dnk drone.vs.drones Sep 17 '15 at 9:00
0
\$\begingroup\$

Make your Camera a child of your Player game object by dragging it onto the Player in the Hierarchy window. The camera will then keep its relative position to the player. When the player object rotates, the camera will rotate with it.

Possible problem: When the rotation of the player is not smooth, the rotation of the camera won't be smooth either. When this is a problem in your case, you need to solve it differently. Keep the Camera as an independent game object, but add a script to the Camera with an Update method which checks the transform of the player and changes the transform of the camera accordingly. How to do this in detail depends on your defintition of "smooth rotation" and "smooth following".

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.