Brain wandering off the virtual camera for no reason.

I have 6 DISABLED VC’s in scene for cinematics and 1 enabled for player camera.
Now for some reason brain decides to start “sliding” away from the root transform that the VC is sitting on.

Basically here is the rig 3194192--243976--upload_2017-8-23_18-17-52.png
PlayerTargetCamera is the VC, the ROOT is rotating on all directions, driving vc’s position.
VC setup :
3194192--243977--upload_2017-8-23_18-18-37.png
as you can see nothing that moves.
The brain :
3194192--243978--upload_2017-8-23_18-19-1.png
And what actually is happening:

Root doesnt move.
Player doesnt move.
As soon as you disable the Brain, it stops.

TLDR: Cinemachine created Skynet, it now tries to escape my pc.

PS: I think it starts sliding away only if i leave the game running while doing something else. (thus no input)

Huh it may be due to float point error btw…
Most likely yeah, damn i delayed the time i had to offset the world for so long, now it seems its the time.

Basically the issue goes like this - the farther you are from the scene zero the more the camera gets offset each frame, and direction is from the center of the map. So yeah, you either have to compensate for it somehow or i dunno.

Edit:
Actually no, it does it even in the middle of the map lol.
Guess it’s not fp error after all, the brain just has ADD

seems it happens here


because it doesnt recognize the fact that its parented and still updates camera world position, i just measured X went in one frame from 10.90093 to 10.90094. When in fact its parented and should not be moved at all.

For now ill simply slap a “fix” a script that resets local position to zero each frame, should work lol

iiiiinteresting. We’ll take a look tomorrow morning. It should not do that, Skynet or not.

If we can’t recreate it here, it would help a lot if you could please package up a basic scene with your setup so we guarantee reproducing it - I’ll let you know tomorrow.

Very strange. I can’t repro the problem, but the code you point out is indeed being a little cowboy.
An easy fix is to just change those lines to this:

            // Push the raw position back to the game object's transform, so it
            // moves along with the camera.
            if (Follow != null)
                transform.position = State.RawPosition;

            // Leave the orientation alone when dragging, because it can
            // screw up position dragging local axes
            if (!SuppressOrientationUpdate && LookAt != null)
                transform.rotation = State.RawOrientation;

That way, it will only push back to the transform when it’s necessary to do so. Should solve your issue.

Hey just woke up will pack a repro. Actually not necessary your fix works just fine . :smile: