My character's body shakes when I use the Cinemachine virtual camera.

I have a first person game, and when I rotate the character on his axis his body parts shake, but on the scene itself it doesn’t happen, only through cinemachine. I tried to change all combinations in CinemachineBrain in Update method and blend update method, but nothing helps. Here is a video with the usual settings. unknown_2023.08.16-01.40_clip_1.mp4 - Google Drive

The character rotation was done with a single line of code transform.rotation = Quaternion.Euler(transform.rotation.eulerAngles.x, mainCamera.rotation.eulerAngles.y, transform.rotation.eulerAngles.z);

The paradigm in Cinemachine is to have separate main camera, virtual camera, and camera target. They should be 3 separate gameobjects, not parented to each other. What happens when you separate you r hierarchy along those lines?

What do you mean by camera target, what do I need it for? The main camera and virtual camera are different objects with no common parent. I don’t understand what third component you are talking about.

9226563--1288494--Снимок.PNG

Sorry for not being clear. You have a first person setup, with the vcam being a child of the player. The main camera is also a child of the player (which is weird). When you rotate the player, what are you rotating? The Player object, or the Y Bot child?

9227079--1288617--upload_2023-8-16_9-23-51.png

With Cinemachine, we try to have a separation of concerns. So, you will have a player object that the human player controls. Then, you attach a camera to that object, either using a passive camera as a child of it, or by making a separate vcam object, outside that hierarchy, that tracks the object. Also outside that object would be the main camera with the CinemachineBrain. It will in turn track the vcam. All of this indirection and separation is designed to allow dynamic flexibility with the camera: point of view switching, blending, etc.

One question I have: why are you using Cinemachine for this? Why not just attach an ordinary camera component directly to the player? What features of Cinemachine do you need?

I don’t even know. In this video tutorial, we made camera control through киномашина.Do you think that it will be easier through a script and a regular camera?

Через скрипт вращаю именно дочерний объект Y bot. I made them children in order to make a prefab of the character with his own camera to implement multiplayer.

Generally speaking, I try to avoid using technology I don’t need. I would set it up so that the script rotates the player, and then the camera follows that. How that last part is accomplished will depend on the needs of your game. What features do you require?

I just need a first person controller)

In that case, Cinemachine is probably overkill.

The entire script can be written in Update, First the line with the character turning, then the line with the camera turning behind the character? Should there be such a sequence?

Just make the camera a child of the head, positioned at the eyes. Then, it will turn automatically with the head.

In this case, the camera will rotate instead of with its head, and the character has its own animations.

Please note that the use of Cyrillic characters is causing your posts to be queued for moderation. Try not to use them then your posts will go live immediately.

Thanks.