- Home /
Cinemachine camera rotating with player 2D
I have a cinemachine camera that is rotating with the player even though the camera is not a parent of the player, the camera's rotation in the transform component is locked but when the player moves it still rotates.
Here is the code that is in the player script, not working but I need to use: private void Flip() { facingRight = !facingRight;
transform.Rotate(0f, 180f, 0f);
}
and here is the code that is also in the player script that changes scale not rotation, it works fine
void Flip()
{
transform.localScale = new Vector3(-transform.localScale.x, transform.localScale.y, transform.localScale.z);
facingRight = !facingRight;
}
Answer by enestelli · Oct 06, 2020 at 01:45 PM
Hello @kikimevy, I'm not sure but I guess I solved your problem. It seems to be a problem with the "aim" property of your Cinemachine. And you probably should use "Do Nothing: Do not procedurally rotate the Virtual Camera."
You can get more detailed information here:
https://docs.unity3d.com/Packages/com.unity.cinemachine@2.3/manual/CinemachineVirtualCameraAim.html