So basically I’m trying to make a very weird 3rd person camera follow and here is what I have for it:
//Orbital horizontal mouselook around the gameobject target
transform.RotateAround(target.transform.position, Vector3.up, 10 * Time.deltaTime * xRot * sensitivity);
//Rotates target towards the rotation of the camera with a bit of delay because it looks really cool
target.transform.rotation = Quaternion.RotateTowards(target.transform.rotation, transform.rotation * Quaternion.Euler(0,180,0), 0.1f);
//Supposed to move the camera in sync with target
transform.Translate(target.transform.forward * Time.deltaTime * target.GetComponent<Rigidbody>().velocity.z);
Basically because I can’t fix the camera’s position to behind my character because the camera rotates around it (unless someone suggests how) I am trying to move the camera in sync with my player using its rigidbody velocity. I have done this to some sort of success. However, when I turn my character, the character moves in the direction it should but the camera does not and instead goes in a different direction. Why is this and how do I fix it? Thanks!