#🎥┃cinemachine
1 messages · Page 6 of 1
Im still on basics i think i will be done with basics somewhere around this night
I still dont know how to do this for exampl
Hey guys got a simple script, works fine while the player moves really smooth but when idle the camera jitters a bunch
the orientation is the player model so the player model rotates along with the camera
you're rotating in FixedUpdate. It's essentially guaranteed to jitter
FixedUpdate is not synchronized to the game's framerate.
Update is
It works fine when i move my character tho, all my movement is in fixedupdate
would i have to move everything over too update ?
and then *time.deltatime on everything xD
no
I assume your character movement uses a Rigidbody and the Rigidbody has interpolation enabled?
well that's where the smoothness is coming from
rigidbody interpolation
which isn't going to happen for your FixedUpdate code here because you're not rotating an interpolated rigidbody via proper means
which object is Orientation and what components are on it
Orientation is the player model
thats whats on the Player
everything else has no scripts or anything added
shouldn't Player itself be rotating?
I would say you want this:
void LateUpdate() {
// your existing cinemachine stuff
playerRigidbody.rotation = Quaternion.Euler(0, mouseY, 0);
}```
note that playerRigidbody is the Rigidbody, not the Transform
ill give it a shot
You might also just be able to do it with the Orientation Transform
But i think it's odd to not rotate the parent on the Y axis
yea i changed that theres still the jittering, its weird if i put it in fixed update then theres no jittering when the player is moving, but theres jitter when the players idle. And then if i put it in update theres no jittering when idle but jittering while moving.
I could just detect when the player is idle to switch between update and fixed update which works but its not rlly a proper fix
show your code
This is it
You're rotating in both...???
Also did you try the Rigidbody version?
I'm using CineMachine and I want to make it so that the camera slightly moves in the position that the cursor is in? So, if I move the cursor to the left, the camera with pan to the left slightly, allowing the player to view the left side more. I've tried making it work myself but I can't figure out how to do it
This is my current game. The camera pans with the camera movement, not the cursor
do you know why my ship is behaving strangely?
ship move codes:
camera follow codes:
this happens more especially in higher forward (speed) values
I just learned how to fix it. 👍 no need for answers
You are moving a non-kinematic rigidbody directly via its transform. That is in direct conflict with the physics system and I wouldn't be surprised if it jittered like you see
i actually fixed it by moving camerafollow codes to lateupdate
ill still look into that transform thing. its what ive learned in tutorial but i guess itx not very efficient
why so slow is this camera
i know its because the objects so big but how do i turn it off ?
like you do in blender
holding down alt mouse doesnt work
tried these
I don't think you can go much faster than that
Its kind of bad to have big objects too as you have to worry about the floating point more (if stuff is intended to go super far) and stuff like max shadow distance will be weird
You can hold shift while moving the camera
The longer you move the camera the faster it'll move
Anyone know why the target group camera's FOV doesn't actually change the FOV?
The lens' field of view is at 40 but no matter what the camera's is always at 3
click an object and press f
or double click an object in the inspector
Oh yeah that exists too
it still be very far away
i need to get close to it (inside) so i can put my camera there
F brings your camera to the object nearly instantly so I don't see how its slow as well
No worries good luck
Just so this doesn't get lost already
Nvm just had to change the radius on the target
thanks 🙂
I just found out a really good thing. if you x100 scale your object and if you have a following player camera you multiply vector3s by x100 too 🙂
Does anybody know how to prevent the lookahead feature from triggering when moving the player in the z axis?
I'm just looking for it to happen when the player moves left or right ;
Doesn't seem to be an option for that by default so I guess it's time for custom scripting
I need some help with my cameras Im about to lose my mind
ive been trying to position them right and make them act like the way I want but I ccant
its been 4 hours 😄
first person camera position:
second person camera position:
kamera parent object
first person camera follower script:
second person camera follower script:
what my first person camera looks like:
what second person camera looks like
I know its been a long postI tried to give as many details as possible
do I need to keep Pixel Perfect component on a brain camera to make some changes in corresponding extension of virtual camera? because I can't see any parameters here, so I don't know where to set my assets resolutions, reference screen size, etc.
or I'm doing something wrong?
Pixel Perfect is a virtual camera extension: https://docs.unity3d.com/Packages/com.unity.render-pipelines.universal@17.0/manual/pixel-cinemachine.html
It doesn't belong on the brain
yeap, I added it to the virtual through Add Extension drop down, not on the brain camera itself, but I can't understand how or where edit it's parameters
What parameters? It doesn't have any afaik
my problem still exists but ive been looking into this stuff hor almost 7 hours now
and I deleted follow camera scripts
also deleted everything related to cameras
then made a cinemachine virtual camera then attached it to main camera then attached virtual camera to cockpit camera
so everythings great except for the fact that its jittery and laggy. i changed virtual cameras update to late update it got better to an extent then changed spaceship's rigidbody interpolation to interpolate
but it still feels not smooth at all
also I want to add this little detail I found out
even when not in camera/game view and in scene view navigating
its still jittery
This is a floating point accuracy error caused by objects being too far away from the scene origin
All coordinates are affected, including transforms and vertices of mesh renderers, not just cameras
but object is almost at 0
i reset the positions before
here. where maincam is ship is near too
its -0.007247... for x -0.0263874... for y -2.960... for z
almost zero
And the parent transform CameraSetup?
That's not it
Remember that every transform position is inherited
To know where CM V1 is you'd have to read its world position, or add to its transform position the positions of CockPitCamera, Cockpit3_WithInterior and Spaceship
More than an issue with camera position, it's an issue with your ship position
cmv1 here
Additionally the problem is not expected to happen when the ship is at 0,0,0 but only when it moves far away from it, starting at 1000 units or so
Very often a problem when people try to make space games to scale
and my scale is 1 1 1
It can also happen at smaller distances if the size of your ship is small
Transform scale is only a multiplier to size so it doesn't tell you the real dimensions of the ship
One way is to create a new default cube with no parent, it'll be the size of one unit which corresponds to one metre
For reference most humans are a little less than two meters tall
You can also reset its position, then select both that and the ship, hit F over scene view and see if there is distance between them
okay
its like 5 meters tall
12 meters wide
Nothing unusual there, if the cubes also have confirmed the position is right
😩
It's very important that they have no parent, as all transforms are inherited
then whats the problem Ive spent my yesterday just on this and couldnt fix it
I have not seen anything except floating point coordinate inaccuracies cause this, so I'm struggling to come up with more ideas
The most telling sign in this video is that the circular dial when wobbling is also deforming like jelly
That is from the vertices jittering relative to each other
no problem. i think this project might have been cursed because i oncee set earth size to trillion or something then set ship size to million then moved its z to 60 thousand or something then i reseet them all but i think the curse remains
There is one more cause now that I think about it
The difference between camera's near and far clipping planes must not be too big, or you lose coordinate accuracy the same way
It's not a property of the vertices themselves but the way they are rendered
and one note to add: I didnt have any problems like jittering even though the ship was at 60 thousand at z axis and scale was 1 million
when i was using main camera as follow camera
when i switched to cinecmera everything changed
There are only a finite number of depth steps that are possible to represent when rendering everything in camera's view
Those steps are stretched between the near plane and the far plane
Cinemachine I think does override the near and far clipping planes
The settings are under vcam Lens field
Cinemachine only moves camera transforms and overrides its settings, I'm 99% sure it's not the root cause of this issue
That said 0.3 to 1000 is not really weird either
Position and scale are inversely correlated for the origin issue
The further away or smaller your mesh is, the more it wobbles
Scaling it up while also moving it away counteracts the wobble
thanks for info will keep that in mind in future projects thanks for sparing time to try to help still I think Ill ditch this project now and conunie with junior programming courses projects. i think this project is cursed that may be all
Almost every space game seems to run into both these issues
You'd usually be traveling at least multiple kilometers, and you'd have to see objects a ludicrous distance away, but also the very nearby parts inside the ship
and now that you said it usually happens around 1000 meters away from origin im thinking my life choices now
Games that try to do real space scales invariably split the rendering of the objects across different cameras or spatially into chunks
how am I supposed to simulate space if only 1 kilometer away from origin this issue happens
Using many technical workarounds
There's probably breakdowns how other games such as Kerbal Space Program and No Man's Sky have succeeded
you played outer wilds?
there are like many different planets and suns there but they are very close to origin
maybe i may do something like that if the technical side of fixing it would be too much for me
do you have tutorial/manuals on that?
i may check it right now
i dont even know what to google for that
Not at hand
to answer the question about orbits:
asusming this is Cinemachine 2.0, you want to change the "Binding Mode" option
Also, is it possible to change the whole Cinemachine orbits ? Like instead of being world reference, it related to the player or an input, and if I click it, the orbits rotate too ? Like if I was changing referencial
The default is "Lock To Target With World Up"
which, unsurprisingly, uses the world up vector
You probably just want Lock To Target With No Roll
but try the different options out
Although, this may just affect how the camera gets tilted. I don't recall if it also changes how the orbits are arranged
I tried it but the movement of my character freaks out if I change it, maybe because the movement function use the camera angle
I'll retry
The thing is that I get the orientation that I want using LockToTarget, but know if I move my character I can't "see his back". Like I want to have the LockToTarget orientation as the WorldSpace default global orientation, so the WorldSpace movement type
Does anyone know if there is an easy way to override the lock on the Y axis (yaw) for a virtual camera that has the binding mode set to world space based on certain input?
Another way of seing this, is there a way to change Cinemachine axis ? Like set it's xyz to a custom vector, and not being the World Ones ?
Okay so is it best to use Cinemachine as a camera system for 3rd person viewing games?
If so, then why won't my cinemachine Virtual Camera connect to my Main Camera, when I installed the Cinemachine Brain component to the Main Camera?
Its not allowing any Live Camera inputs
you don't manually touch CinemachineBrain at all
it just needs to exist on the main camera
I'd remove the CinemachineBrain and add a new vcam to the scene
this will automatically attach a brain to the main camera
Alright I did what you said, And yes it automatically gave my Main Camera the Brain, it didnt connect the Virtual Camera to that brain
And it still remains
as there being none in the Live Camera slot
show me the inspector for your virtual camera
I havent set an object to the follow and look at
But when i do it changes nothing
Does this help?
What happens when you hit Solo on the camera?
anyone know how to make it smoother when using transform?
it looks very. bland and robotic.
searched for tutorials could only find some for follow
im tryna use transform
@errant shard sorry for doing this to you. but i know you are extremely helpful and i could use your advice here.
Not all that necessary, I go through all channels if I have time anyway
It's very unclear what "use transform" means
How, and in what context?
use transform as in i record the movement i want the camera to do through recording in timeline
Animation curves let you create smoother keyframes
If you're using virtual cameras they have a noise module to add a bit of sway, or to simulate handheld camera shake
any idea as to why it came out sorta pixelated?
you can see a few like. squares that just look bad.
this might be a better example
noise doesent seem to work :/
Can someone tell me why this isn't working???
Did I do something wrong? In the cinemachine set up? or download?
If you aren't using Cinemachine 3.0, then this should be fine.
(and you'd know if you were doing that)
go to Preferences, then External Tools, and hit "Regenerate project files"
and reopen your code editor
Of course that variable is invalid syntax, so that will need to be fixed
Thank you I was a bit in a rush but reloaded my editor now it works
Is it possible to use Cinemachine Impulse Listener and Source for shaking other objects?
So I have the basic FP movement script along with its camera setup on a model, but I am having a problem that the player's body can be seen as somewhat see-through when the player walks/runs. I have tried adjusting the position of the camera as well as the near clip plane, but in doing so I cannot see the arms swinging back and forth. Is there something else I can do?
guys i downlaoded cinemachine for my2d game im learning , but when i add a virtual 2d camera it keeps moving and rotating weirdly on its own , can someone help me please i have no idea whats going on\
nvm i fixed it
in case any one ever faces the same issue , dont set the virtual camera as a child of the main camera
Virtual cameras should generally not be children of anything
hey does anyone know why my cinemachine 2d camera is lagging (idk if this matters but the player is being moved by Rigidbody.MovePosition() in the FixedUpdate Method)
i think this solved it
you shouldnt do it for everything its expensive. for main player is good
o7
what are you doing with 4 browser lmao 😂 anyway...
idk 😄
yea i thought it should be a child of the main camera which caused the unexpected behaviour
sometimes it could be better to just attach a script to the main camera that sets it to the same coordinates as the player or a bit different ,am i right?
Should be
Cinemachine's importabke examples have a scene showing how to create shockwaves for arbitrary objects
A mean I never have used cinemachine in 2d but in 3d for certain scenarios is good
also there may be some problems whenyou do that
thats not an issse in normal main camera
like especially if you set it as child or something
but I think the follow player option of cinemachine was nice in 2d
i'm experiencing some weird ghosting effect while the camera is following the player, i would send a recording but for some reason it isn't noticeable in video
Can you confirm it's not just your monitor doing it under those circumstances?
I'd also check without no post processing or antialiasing, as for example TAA can cause ghosting
If you're using sprites, are you also using the pixel perfect camera component?
no
i tried changing my nonitor refresh rate to 60 and it fixed it, 120 dosn't work neither 144
ok pixel perfect fixed it thanks
Pixel perfect typically causes it
mhhh it seem to be going on / off, i didn't change anything and it's back
Another common cause is moving the camera and character in different Update methods
For example a rigidbody with no interpolation has its position updated 50 times per second, but the camera may be updated much more often with a high framerate
That can also cause the problem to be concealed when lowering your monitor's refresh rate or recording a video that's not of a very high framerate
if i start the game it's fine, i click the inspector, back on the game and it's ghosting
if it was this how would i fix it
I'd rather first hear some clues about what's happening in your end
Are you using sprites? Are you using rigidbodies?
yes the player has a sprite renderer and it's fisics works with rigidbody2d
Try enabling interpolation on the rigidbody
seems to be fixed but as i said the bug was pretty inconsistent, thanks a lot anyways <3
The bug itself is consistent, but it can be easily concealed, or compounded by other problems with similar symptoms
For example if performance in the editor drops and your framerate is lowered as a result
Testing a build is the most effective way to know
But note also that editor and build may have different VSync settings which again in turn affect the framerate
VSync is usually best be enabled in both build and editor
How do you freeze the X axis on a cinemachine camera in 2d unity? (So that no matter what the camera doesnt move on the X axis)
Anything to do with the motion of the vCam will be in the Body settings for the vCam
Ah I found it thanks bud
how to rotate free cam?
How do you want to rotate it? You can configure the axes on the aim
when someone touches the screen
axis is setup
something not working in code
If it's not rotating when you move your mouse, then I can only guess there's errors you're ignoring
its for mobile
im taking touch input
Getting input from a device, be it touch screen or mouse, and having virtual cameras utilize that input are two separate systems
Troubleshoot them separately
touch part is not working when i touch the screen , it does not log into console
if (Input.touchCount > 0)
{
Touch touch = Input.GetTouch(0);
// Log touch input values for debugging
Debug.Log("Touch Delta X: " + touch.deltaPosition.x + ", Touch Delta Y: " + touch.deltaPosition.y);
That confirms at least that it's not a Cinemachine issue
ikr
But I think Cinemachine's importable examples on the package manager do include a touch screen demo
If not, the Starter Assets asset certainly does and that one also utilizes Cinemachine
thx for help, found an inbuilt script
Hello, I'm trying to make something where if you enter a volume, the camera is slightly displaced to another location (e.g when the player gets on the edge of something, the camera should pan down slightly so that we can see what's below.)
I'm currently doing it this way: When we enter the volume, create and setup a target group (with the player transform and the other point). Then, change the VCam's Follow transform to be the target group. When we exit the volume, remove the target group and make the vcam's follow transform to be only the player.
I'm also lerping the weight to try and get a blend, but this part doesn't work.
The few problems are :
- When the two points are close, the camera zooms. I don't want that (I tried setting a big radius on the other point but then it doesn't displace the camera a lot)
- Maybe it's because of pixel perfect (Im in 2D btw), but the blending just doesn't work at all. The camera still instantly snaps to include both points or only the player. It looks like it does so when the other point's weight reaches 0 or 1.
Is there a way to fix this?
Rather than trying to get your vcam to partially use different settings, make another vcam that fully uses those settings and then blend partially to that vcam
that's clever. I'll try that. Thanks
Not merely clever, the officially recommended way to use Cinemachine is to prefer multiple VCams and switching or blending between them rather than modifying their settings
The docs are well written and contain a lot of real world useful advice so it's best to make sure you've read at least the first few chapters
yeah I'll read the docs. That's something I should do more often tbh. Thanks
How to change camera tilt with virtual camera in 3D project?
The orientation of the camera is determined entirely by the "Aim" settings and whatever is assigned to the "Look At" field
if you have "Aim" set to "Do Nothing", then you can just tilt the camera via the Transform like any other GameObject in Unity.
really vague question. Here's my vague answer: put it there
wdym lol (welp 🙏 )
It's unclear what you're asking
What do you mean "change camera position"?
Like... is it already positioned there and you want to ...change it in some way?
Are you asking how to transition the camera from some other configuration into an over-the-shoulder one?
What are you asking?
the position of the virtual camera is determined entirely by the Body settings in the virtual camera
And how could I change the settings,I know nothing about unity
The settings are in the inspector of the character?
they are in the inspector of the virtual camera
btw FPS games do not use over-the-shoulder camera
they are first person
they use a camera inside the player, as if seeing from the players' eyes
the main camera,right?
no, the virtual camera
this is your project window
things in your scene do not appear here
things in the scene are in the hierarchy window
you may not have found it, but that doesn't mean it's not there
it should be pretty obvious, it'll be part of the player or the camera
u've been online for 14 hours dang
pretty sure it's a FreeLook
so you could do t: CinemachineFreeLook in the hierarchy
even by searching Cinemacine I got nothing
well searching "Cinemacine" isn't going to find anything
oh wait found smth]
Cinemachine Free Look Mono Script and another script called the same
first one got a imagine w a camera the second got the default script image
again sounds like you're looking at the project window
yh cuz I find nothing in the hierarchy
Based on this screenshot from the asset youtube intro, it looks like the MainCamera object is what you want
you can see the cinemachine logo there
or wait
it's probably the PlayerFollowCamera
that will likely have the vcam on it
PlayerFollowCamera got something in the inspector called "CinemachineVirtualCamera" this is it?
Yep
as I said much earlier, you want to look in the Body settings
tysm man
uh im such a idiot that I don't know where is the verical movement of the camera.I only managed to move it closer and a little to the right
shoulder offset I assume?
That was it,thank you very much!
Hello, I have my camera set to Simple Follow with World Up, the Y axis being set to my character (because he can walk on walk, thus I rotate the orbits with my him). As you can see, when I move laterally, he spins around the cam, wich I guess is pretty logical because the cam World Axis is moving, but how can I avoid that ?
should i use cinemachine on a first persson controller or stick to the regular camera also is it easy to switch from regular to cinemachine later on?
you don't get a huge benefit from cinemachine for basic first person games but I use Cinemachine for every game
thanks
when I move my third person camera to a wall it goes thru it and when I try with a object its the same,how can I fix it?
and how do I make it so when im moving the camera on vertical axis it doesnt go more far away than when at the middle of the character
@worn canyon Look up Cinemachine Collider extension and Free Look vcam on the Cinemachine documentation
Both of those questions will be answered
ty
it still clips thru walls
I can still move the camera thru walls but when the camera is at the edge of the object it brings it closer to the character
@errant shard welp
Hello ! Someone know a way to make cinemachine brain following freelook by layer even if the brain doesnt have camera component ?
(please ping me for the any reply)
I'd have to assume you didn't do it correctly
If the docs aren't alone enough, Cinemachine on the package manager also has importable examples
They should include both types of cameras
ty
has anyone managed to get the timeline to stop without cinemachine reseting the position of the camera? I'm trying to make it so I can stop a playable director and cut immediately to the virtual camera at the highest priority, but for some reason every time I do this it flickers for one frame. My code isn't running in a coroutine and I've even tried manually updating the cinemachine brain when I change it to no avail. It seems to continue even when I disable the playable director. I'm kinda at a loss for what you're meant to do here.
im pretty sure the single frame that flickers is actually the final position that the camera would end up if the entire timeline clip had played out
edit: actually, the single frame is the final position of the virtual camera it was in the middle of blending to. So it's just snapping to the final position of the blend.
at the moment of the order of execution is:
- pause the playable director
- set all the virtual cameras involved in that timeline clip to priority 10
- set the priority of the next virtual camera to be 11
- stop the playable director
- disable the playable director component (no effect)
CinemachineCore.Instance.GetActiveBrain(0).ManualUpdate();(no effect)
and somehow despite all of that occuring in sequence with zero yields
a lot of that stuff is just redundant things ive added in testing to see if that makes the behaviour stop as well
the timeline clips have only a cinemachine track in them
here's the one i've been using for testing for example
fairly certain the problem is with the step 4
because if I don't stop it then even after disabling the director, it just freezes in place
heres footage of it happening
its fast but its there and it feels really jerky
i would like to not have sonic boom cutscene energy throughout my entire game lmfao
it seems even manually disabling all the virtual cameras cant even stop it
this cannot be intended behaviour
2023.2.7 URP if its relevant at all
cinemachine 2.9.7 timeline 1.8.6, they're the most recent versions
cool
oh disabling the literal gameobject associated with the directable seems to have done something
nope
still does that one frame thing
so weird
setting the brain to late update has also not changed anything
oh just made a new discovery, updating this message
only changing the priority of the virtual camera just before the playable is scheduled to end also doesnt prevent the snapping
huh????????? changing the sequence of the shots has stopped it from happening??
it seems like if the virtual camera has been active once before, this does not happen???????????????????????
so the workaround is to flip through every virtual camera for a frame each before starting the scene
if only there was a way to manually trigger whatever this initiation thing is from the code
InternalUpdateCameraState() didnt do anything unfortunately
oh i fixed it!!
MoveToTopOfPrioritySubqueue() did the trick
i kinda get why that mightve been the fix even if I did try to be careful about the order I was setting the priority alrteady
this could also use some documentation
i assumed it was from then to
and digging on the internet i could find absolutely nothing about which is which
and then i tested it and nope its the other way around
its also being called twice for whatever reason
thats probably on me though
actually yeah i can think of why that might be happening
Help me 😭. I am trying to fix the sniper scope but it's not possible. I have one cinemachine camera and then another camera in front of it. However how to dynamically adjust FOV of the second camera so it matches first one? First camera has FOV 20. So second camera should have smaller FOV but how to calculate it?
FOV second camera = zoom factor : FOV firstcamera ?
FOV Second Camera = FoV First Camera : Zoom Factor
from my math knowledge i would calculate it this way 😄
Huh?
Zoom factor is 1
float fovForSecondCamera = 2 * Mathf.Atan((firstCamera.fieldOfView / 2) / distanceBetweenCameras) * Mathf.Rad2Deg;
secondCamera.fieldOfView = fovForSecondCamera;``` @feral quail how about this? Will this work?
Im rly New as my Marker Shows , i legit didnt use any Knowledge beside Math ^.^
You Said youre Trying to Use a Scope.
So Basically youre Base has a FoV of 20 and a Scope is normally Used to like 2x 5x or Whatever x something.
If youre Having a Base FoV of 20 and Ure Using for example a 2x Scope youre new FoV is 10.
Based on That i gave u that Formula above , which as im ReReading it shows me that i made a mistake. 
FoV Second Camera = FoV First Camera : Zoom Factor. My Bad on This.
...if factor is 1 then fov of second camera should be 20 as base but that doesn't work because that sniper camera is in front of base cam
Yea, maybe it needs diffrent properties aswell , im out for cinemachine then.
I currently have a system where there's water at y=0 and all items and the player check in update if their transform.position.y is underwater. I have a collider on a Water layer, but I only use that to make sure the camera never dips underwater.
I want to change it so the water is a trigger collider so I can replace my update() code with a simple ontriggerenter. But if the water collider is a trigger, how can I keep the cinemachine cameras out of it instead?
Hello, I don't know what I did wrong but my camera is moving steps by steps, you can see it in the video, it's more noticeable when I move the camera slowly.
I am using an input provider with the input system, how can I smooth out the rotation of the camera ?
what's your update set to on your cinemachine brain?
So I thought I solved my problem by having a dedicated layer and object just so I can listed in cinemachine's body's "Camera collision filter", but while it works if I try to aim the camera into the water collider, when the player jumps in water, the camera seems to snap inside the collider.
looks like as soon as my follow target dips inside the collider the camera snaps behind it, I'm going to just "manually" move my follow target above water when the player enters water, but I wonder if there's a way to force cinemachine to respect the collision filter.
I have similar problem with Cinemachine. Our players complains about sick motion because of that laging camera. We have 60fps without any lags. Our character movement is perfecly fine, smooth. But camera rotation is like yours. Even without player movement. If you will find the solution let me know 😛
I checked rigibody interpolate/extrapolate
I checked every update mode on cinemachine
makes special physic layers
nothing works with this
it's hard to see but easy to feel the bad camera rotation
turning off post procesing also makes no difference.
So how to achieve 60fps smooth camera rotation?
What method is rotating the vcam here
show the configuration of your input action
I tried other update methods in that list
but fixed update has the less jittering than others
This does not reveal what rotates the camera or how it does it
oh you mean player controls. We are using ECM2
when I go deep to this asset I found that probably camera rotation is by this:
So the player is rotate in fixed update and the camera is just following him (in this asset case)
ECM2 out of the box uses horizontal movement that's smoothed to rigidbody's rotation that's interpolated with the rb setting "Interpolate"
Cinemachine itself should update in late/smart update
The interpolation setting is a prefab override, so it's possible that the option you're seeing here is not the same way in each instance of the prefab
You should verify that the unmodified first person demo character of ECM2 does not have this issue
Then you can use that to compare
I would check here what's the actual interpolation mode of the very specific player rigidbody that's moving the camera here
It's always possible that the prefab is different than the one you showed earlier
Or that something else is affecting the rigidbody's rotation
It's not really a cinemachine issue though, or probably exactly an ECM2 issue either
If setting the cinemachine update mode to fixed update makes it the smoothest, that doesn't mean that it's better but it implicates something causing uninterpolated rotation on your rigidbody
Verifying the ECM2 included demo fps character can help you troubleshoot it
Or copying it over if all else fails
And if the problem comes back during that process that means it's one of your components doing it
Possibly overwriting the rotation
ok I will check. They don't use Cinemachine, so I need to set up this on their demo scene
I have "EYE" empty gameobject and the vcm follow this empty.
"EYE" is a child in player with rigidbody
can this be a problem? that the vcm don't follow directly player, but his eye?
Character Movement / Walkthrough / 14.- Cinemachine /
Whether it's cinemachine or not doesn't make a difference though, in my opinion, since it looks to be an interpolation issue
I expect you have the same jitter even if you'd swap it out for a totally ordinary camera
hmmm in ECM2 movement is on fixed update by physic, but rotation is also on fixedupdate but without physics (just transform)
maybe this is the problem?
That's not quite how ECM2 is set up
Like I said in ECM2 sideways rotation is done by rotating the rigidbody in an interpolation-conforming way in fixedupdate, up and down rotation simply rotates a non-rb transform in update
Out of the box there are no jitter or stutter issues
Cinemachine in lateupdate is just as accurate as rotating the camera directly
If you're additionally doing rotations in the wrong update, or using non-rb rotation methods at any point, it's no wonder that stutter issues crop up
Anyway, not really an on-topic issue
You should find that ECM2 works fine with default configuration
ok I will check the default ECM2 conf. Let's assume this is correct, so then how to find or resolve my problem? Find if there is some script making players rb not interpolate?
Yes, verify that really all instances of the prefab have interpolation enabled, no script ever moves the rb with a Transform class method and that no script moves the eye/vcam in fixedupdate
Additionally for your purposes the Brain should be using Smart or Late update for everything instead of Fixed
ok I will check, and just for curious. If the fps will jump between 60-100 is possible that this will be the problem?
It should not have any effect
Though consider that since physics timestep is 50 times per second (by default) that means that you might not spot issues arising from being restricted to physics timestep if your fps is also that low, or if your camera also updates at that rate
I checked and players has interpolate in build all the time, also I check the scripts and there is nothing you mentiond (i don't have rotation in wrong update or using non-rb rotation). This is just ECM2 and Cinemachine I don't edit in this asset anything
I double check v-sync and fps lock. everything is ok.
I even updated the packages
still the same issue. but I discovered something new, the bigger windows size is the more you will see the jittering effect
That usually implies some fps-dependent code
Which ECM2 is not, I can confirm
You should not have any "fps lock" besides vsync
But consider that vsync limits your framerate which is generally good but may conceal fps dependency issues
You'll want to double confirm that a freshly imported ECM2 base does not have this issue
If it still does, you'll want to make a post in the official support thread
Hello
How do I prevent this from happening?? When the player goes up , keeping the camera down
Sorry for the late response
This doesn't have the requested information
Show the action itself, not the binding
anyone?
This ?
Yes. Make it action type: Value
Also what settings are in the "Driven Axes" thing?
THANK YOU that was it
If you still want to check
im a beginner but that looks lovely !
How do I add screenshake? I'm looking online and people are saying to use MultiChannelPerlin component but I... don't have that component? It's not something I can add
Looks like you're working on 2D objects
In that situation your vcam should not have any rotational noise, and no Z axis motion in the noise
How do I set that?
You will need to change the noise profile
The next page on the docs after the one I linked: "Working with noise profiles"
Thank you, I will look into it
one more thing, if I use a custom NoiseSettings, can I set that dynamically in code? There's a particular effect I want where the force of a certain impact determines how hard the camera shakes
hmm looks like I might be able to
Cinemachine has Impulse Source and Impulse Listener components for this purpose
The importable example will show how to use them
Would you possibly be willing to hop in voice chat and help me out with this?
Nevermind, got it working!
Hello, I have cinemachine virtual cameras put on car prefabs and I've been trying to figure out how to adjust the virtual cameras rotation to be able to look around the car 360 degrees by script and user mouse input. I want the user to be able to look around the car and check it out then lock back to center when they lift up for a period of time, or something like that.
I haven't been able to figure out how to use anything like pan tilt for cinemachine though
this is the virtual camera setup on a car prefab. most cars are basically the same
does anybody know how to get the camera to rotate around the object it's looking at?
Make this hierarchy:
- target object
- pivot (no offset)
- camera (offset as desired)
- pivot (no offset)
Then just rotate the pivot object
You can set Body on the vCam to "Do Nothing" and use Aim and Look At as normal
thanks for the suggestion, i'll probably go with that approach
i'm messing around with the Cineamchine Free Look script settings right now
seems to be pretty much what i'm looking for but idk if i'll be able to get it quite right
hmm. I got screenshake working but now afterwards my virtual camera drifts around.
Ok, well, I managed to stop it from drifting, but now my character keeps disappearing
Your vcam appears to have rotation, which it absolutely should not in 2D
If you want a safe way to disable noise, instead blend between a vcam with the noise and another without instead of modifying it directly
Blending between vcams is how cinemachine is meant to be used
so I figured out Cinemachine Virtual Camera has a POV setting for the Aim mode. I'm using that now and backing the camera off with the CinemachineCameraOffset script. that seems to work pretty good and give me control over the camera like i wanted, but i'm having an issue where it shakes a little too much with the car now
got it figured out, it was because I had the camera as a child of the car and then also i had to set the recenter target in the Aim settings of the cinemachine and hard lock to target
Hey everyone, need some help. I've got a Vcam attached to my player and I want the cam to slightly pan when the mouse moves to the edge of the screen. It seems like I'm able to do it while I change the Vcam settings while in game, but it messes up if I change it in editing mode and then play. Can anyone help please?
I'm surprised it's doing anything at all since your vCam's Follow and LookAt are null
You seem to be relying on parenting your camera to the player instead of the actual vCam settings
What you need to actually do is unparent it, then set the follow target for the framing transposer as a target group containing the player and an object that follows your mouse cursor.
POV isn't panning your camera, it's rotating it. Which you don't want in a 2D game
So I'm using a CinemachineVirtualCamera with the AIM setting to POV. now i see that when you use a freelookcamera there are properties you can access to disable and enable users mouse input to rotate the camera, for example -
public CinemachineFreeLook cameraLook;
cameraLook.m_YAxis.m_InputAxisName = "Mouse Y";
cameraLook.m_XAxis.m_InputAxisName = "Mouse X";
i see the properties in the CinemachineVirtualCamera script for the X and Y input axis names but i can't seem to figure out how to access them through code.
anybody know how to access those properties?
Access them to do what?
I mean, the short answer is of course "on the FreeLook": https://docs.unity3d.com/Packages/com.unity.cinemachine@3.0/api/Unity.Cinemachine.CinemachineFreeLook.m_XAxis.html
But what are you trying to do with it?
Aren't you accessing them in code in the example you gave? I'm confused.
is there a way i can have the dead zone width different on both sides?
im making a 2d platformer and i have the camera following the player, but i dont want it to be centered, since the player starts on the left side so the whole left side of the screen would just be blank until the player moved far enough
so i changed the "Screen X" value so its shifted to the right, but then when i go back, the camera doesnt follow until you get really far back, where you cant see the player for at least 5 seconds before it happens
there's probably a better way to do it but i dont understand how
use CinemachineConfiner
where do i find that and how do i use it?
thank you
now i have a problem... i added a polygon collider for the camera confiner, but now it lets me jump when im not touching the ground, so i can spam jump pretty much
change the layer that the collider is on
it shouldn't be on a layer that interacts with the player (or anything else, really)
yeah... I wouldn't make the camera confiner collider interact with the player
oh sorry, I forgot to post that I ended up figuring out how to access those properties I was talking about.
i'm using the CinemachineVirtualCamera script with the AIM setting set to POV. So I had to specifically grab the POV component to access those properties.
CinemachinePOV cmPOV = CMvcam1.GetCinemachineComponent<CinemachinePOV>();
cmPOV.m_VerticalAxis.m_InputAxisName = "";
cmPOV.m_HorizontalAxis.m_InputAxisName = "";
oh sorry again, I didn't answer your question.
I need to access those properties because when the player gets in the car, the player camera switches to the car camera with a 2 second delay transition. so i wanted to lock the POV from getting input from the user while the camera transitions and then give them the ability to rotate around the camera afterwards
my post processing isnt working. is it because i use cinemachine as well?
Cinemachine has very little to do with PostProcessing. It more or less just positions and rotates your camera
hey guys, i'm doing the john lemon tutorial and for some reason, my cinemachine doesn't follow my johnlemon player anymore
this has happened after adding post processinfg effects, i reset the camera and followed the tutorial again but it's still not tracking the JohnLemon game object
A camera with the cinemachine brain component will follow the active vcams
When implementing post process I expect it's possible you may have removed the brain component or made a new higher priority camera without the brain
how would i change priority for the cameras
Do you need multiple cameras? Not talking about virtual cameras
It sounds like another camera was created in error
I think i have just main camera and virtual camera, lemme check
You can type t:camera in hierarchy window search to reveal all camera components
Your probably want only one camera (unless you have a valid reason for another) which would have your cinemachine brain
it seems i have 3
I see two within the MainScene
And it seems indeed you created a new camera for your post processing
You would instead implement the post processing in your Main Camera rather than making a new one
Currently Cinemachine is controlling the Main Camera as seen with the red icon, but your other camera is being rendered over it
i'll delete my globalpost then and do all the components directly into my main camera
I'm making a 2D game. I want the camera not to move in the Y axis. Is there a simple setting to turn this off?
Well cameras don't just move on their own, so it really depends on how you're moving it in the first place.
all camera movement options are under the Follow settings for your vCam
One simple thing you could do is create an empty object that follows your target on the x axis only using a PositionConstraint
and have your vCam follow that object instead
How can that be done? In code*
there's no code required
If there is no code required, then how can I make the new object follow the Player?
using a PositionConstraint!
actually, let me get you a manual page, not the scripting reference..
I already explained that here #🎥┃cinemachine message
I need some help, i have a 3rd person player controller with a cinemachine camera to follow the player. the problem is that my character spawns in from a prefab because i have a choose your character screen. I am having trouble getting the camera to detect and follow the player that spawned in from the prefab. Help would be so appreciated! 🙂
You can set LookAt and Follow in your CinemachineVirtualCamera after instantiating your prefab.
Simple - include the virtual camera as PART of the prefab
How does one avoid this blur affect from the cinemachine cam?
Its just very laggy when the camera follows my ship
enable interpolation on your rigidbody
You can set the update of the cinemachine brain to be later in the frame, that avoids a lot of jittery stuff.
In this case because the followed object was a Rigidbody without interpolation, it was real jitter from the object.
Hey all, so I'm pretty new to Cinemachine and am trying to get a 'follow cam' system to work using it.....
This is how I've got it set up and it sort of works....
The problem I'm having is that I need the camera to stay behind my ship, but it's not moving with the back of the ship and I'm a little confused as to how to get it to behave.
Could anyone point me in the right direction please?
i got unity to render 8k this time idk what was wrong on the last project (I turned ray tracing off for the render, there's over 150 lights)
thank you! so.. do you have an idea maybe, why it isnt working?
Best to ask in #💥┃post-processing
yeah i did but no answers
Why does cinemachine hate 90 degrees
Wait no sorry why does it hate 80 degrees
It shouldn't be flipping at 80 degrees
Correction
Why is cinemachine rotation just completely off
It's completely wrong
I capped my GameObject's rotation at -70 and 70 using clamp which is working fine it is capped
But cinemachine likes to think -70 is equivalent to -50?
and 70 is equivalent to 90?
My bad my vertical arm length was 0.4
is there a way to rotate the "rails" the free move cam follows?
my player walks on surfaces that are not flat so I want the camera to rotate along with the player
I believe this is a cinemachine issue as it doesn't seem like the parallax itself is acting up. My paralax object keeps jittering while the cinemachine cam moves with the player
It doesn't look like a cinemachine issue because your vcam stays fixed on the player
Either your player is rubberbanding, or your parallax background is
How do you install Cinemachine 3
OK you just have to add by name and specify the version
You can also select 3.0 after installing the package normally.
I have a set of "outside" cameras and a set of "inside" cameras. I want to do a little fade-to-black transition when moving from outside to inside and from inside to outside.
Currently, I have these blends configured (they use Cut because I haven't actually implemented the fade-to-block yet), but it's a nuisance for a few reasons:
- I have to name every single internal camera "Internal Camera"
- I can't just use the default blend between internal cameras; I have to explicitly add an entry to the list
Is there any way to override how Cinemachine decides which blend to use, or am I going to need to modify CinemachineBrain?
Ideally, I'd be able to write a method that takes the two cameras and returns a blend
(also, in reality, it's not just "outside" and "inside", but rather any number of groups of cameras)
there could be foo, bar, baz, and buz cameras that all need to be faded between
Can you use this with Cinemachine State-Driven cameras?
I.e. have one state driven camera that contains all the outside ones and another that contains all the inside ones?
And then only define the blend between those parent cameras?
(I genuinely don't know if that's possible)
Cameras are attached to individual entities in my game, so it'd be impractical to group them all under one big state-driven camera
I've already embedded the Cinemachine package so that I can adjust its execution order (to make it play nice with other third-party assets)
so, worst case scenario, I directly edit CinemachineBrain
It has an m_BlendManager field that holds the BlendManager, and that thing has a LookupBlendDelegate, which is what's used to actually pick a blend
m_BlendManager is private, though
everytime i stop moving there is like a blur wave that goes across my screen
so my the confiner for my cinemachine becomes smaller than the actual orthographic size of the camera, causing this stuttering
is there some option i can press where the cinema mcachine orthographic size adjusts when the confiner gets smaller than it to prevent this issue
Look into the Pixel Perfect camera
I ran into an interesting problem with spline carts today. Took me a bit to figure out...
A rotated SplineContainer causes the cart to rotate itself incorrectly
rotation = rotation * spline.transform.rotation; // backwards!
transform should really just have a TransformRotation method on it 😉
does
transform.localToWorldMatrix * rotation``` work?
That operator doesn't exist
- with Vector4 is there
and Quaternion has a conversion to V4 no?
oh shit it doesn't have an implicit conversion :0
That wouldn't be a meaningful operation.
that's like using TransformPoint, i believe
Should it be:
rotation = spline.transform.rotation * rotation;``` instead?
Order does matter
my cinemachine is lagging it feels like its snapping to the target a few times a second rather then locked onto it and following it(high frame rate)
fixed it
what was the issue?
My guess would be Rigidbody interpolation not set
I have a camera in the character that’s attached to the character’s head. The animation causes character to start shaking. I decided to use the Virtual Camera (it follows the empty "zxc" object in the character’s head model) from Cinemachine.When I run the game alone, everything works fine.But when I enter the game with 2 clients,then the script CinemachineVirtualCamera disappears in VirtualCamera and creates a child element cm. what can i do?
Sounds like you're destroying the virtual camera in your code
The vCam always creates that cm object, it's just usually hidden
how do you guys get vcam to match a rig object's rotation
i have it following it just fine but something made me think rotations would carry over too.. for somereason.. is it appropriate to use a gameobject out in front to aim at?
generally by pointing at the root/hip bone of the rig I think?
yes, that also minimizes the amount of camera shake you get
cinemachine looks "shaky" only when moving the player down and right - any ideas?
by shaky I mean it has the same effect as in all directions without interpolation on
but only in the down and right directions
show your movement code
for what
for the movement
yes, i keep forgetting to use fixed update with physics lol
I'm aware that it's possible to blend between 2 virtual cameras, but can I specify the blend with a value? For example, let's say I have a vcam at x=0 and another at x=5
with a blend value of 0.5, I would like to position the camera at x=2.5
Hi, on cinemachine i want to make it so when the player jumps the camera doesnt go up with it, anyone know what do do?
hey i was trying to setup confines for my camera but its being weird with the positioning of my character
That is how blending works, yes
If you mean you want to stick to 0.5 weight in this case rather than passing through it when blending, you can use the Mixing Camera component
The simplest way might be to increase the dead zone and soft zone values
Mixing Camera is exactly what I'm looking for, thanks! Currently I am lerping every property between the two vcams which seemed like way too much work
The purpose of Cinemachine is to automate many use cases like exactly like this
I recommend reading through the manual when using it
https://docs.unity3d.com/Packages/com.unity.cinemachine@2.9/manual/index.html
It's well written and explains how to make best use of the system
Cinemachine also has importable examples for almost all of its features available in the package manager, if you're wondering how to implement something
I've used cinemachine for years, but sometimes I'm looking for a particular feature that I might not be aware of
Hey, so I increased the deadzone value but when my player goes above the value the camera follows, but it doesnt follow going back down. Can someone help
can someone help me with this error
its just popped up out of nowhere and im not really sure how to fix it
update your cinemachine package
restart unity
delete your library folder
in that order
where is the library folder
It is a sibling to your assets folder
Just in the root project folder
In picture, I can see the room's ceiling and floor, but the room is on center. I want move room to up. but how to? I use Persepective mod cam
What's the question exactly? How to move the camera? Or how to move an object?
I want move objects but I need still can see ceiling and floor
Actually, this question is not a Cinemachine question. It's just that this is the only camera-related category. sorry!
To reiterate my question, you can see both the ceiling and the floor in the photo. But now that room is in the center of the screen, and I wanted to move it to the top of the screen, but still be able to see the ceiling and floor.
I don't really understand the question.
So, I want to move that room upwards just like that. However, as shown in the photo, the camera must focus on the ceiling and floor of the room at the same time.
yessss but how to
Use #💻┃unity-talk for questions related to cameras that aren't cinemachine
how would i change the cinemachine default blend in code?
I feel like im missing something really simple here. I'm trying to use the dolly cart shift a camera from one position to another when clicking a UI button. I thought there might be away to do this using the On click on the ui button, but I'm stumped on what to use as the on click.
Someone knows how to fix this proble,? I have a white border in the game scene? That appeared suddenly and when I start the game is blinking all the time and its supper annoying, idk how to fix it
You turned on Gizmos
turn them off
it was activated before because i was checking hitboxes
but the cinemachine brain just appeared suddenly
and i dont understand why is all the time blinking when the game starts, is that normal?
you can turn on and off individual gizmos from that dropdown menu
not sure what you mean by blinking though
its all the time appearing and dissapearing when the game is running
at a high speed
its really annoying
is that normal?
Share as mp4
so it embeds properly in discord
and I don't have to download it on my work laptop
@royal tartan
yeah that's just the gizmo for your canvas or the camera or whatever
turn it off if you don't want to see it
As I mentioned earlier you can disable individual gizmos if you want
it doesnt affect performance or when exporting the game to launher then?
no it's for the editor only
Hi all, I've a question about raycasting from the from the cursor through the camera.
I'm using a perspective camera, pulled back really far from the scene with a low FOV (set to 3) to get an orthographic look.
Setting this way causes problems with raycasting, as the distance the ray travels means small cursor movements end up as big jumps when they hit the scene.
Could anyone suggest a solution to this problem?
You might want to test if increasing the camera near plane and decreasing the far plane as much as you can has any effect
Otherwise you might need to figure out some other method of raycasting, as there are multiple ones
This doesn't seem have anything to do with Cinemachine, though
Moving the planes has really improved this, thank you! You're right, more of a Physics or General question really, I'll aim to categorise properly in the future. 🙂
Guys how can i achieve a camera that looks like this one? https://it.crazygames.com/gioco/crazy-roll-3d
When using cinemachine to move a camera from one UI menu to another using a camera and dolly is it better to turn that transition into an animation? Or is there a better way to trigger the transition with the UI buttons?
hey guys I have I have these Cinemachine virtual camera and I have them switch locations depending on where u are Im curious if there is a way to not make them smoothly rotate and instead make it instant?
nvm i got it
Im trying to make a smooth transition between two different cameras and am having some trouble
using UnityEngine.InputSystem;
public class CinemachineScript : MonoBehaviour
{
// Start is called before the first frame update
[SerializeField]
private InputAction action;
private Animator animator;
private bool mainCam = true;
private void Awake()
{
animator = GetComponent<Animator>();
}
private void OnEnable()
{
action.Enable();
}
private void OnDisable()
{
action.Disable();
}
void Start()
{
action.performed += _ => SwitchState();
}
private void SwitchState()
{
if (mainCam)
{
animator.Play("ADSCam");
} else
{
animator.Play("NormalCam");
}
mainCam = !mainCam;
}
}
wait
nvm
ok wait its like being jerky
instead of easing in and out
its just latching onto the camera
What's the Animator for?
You can use "custom" type blend to customize the blend between vcams without having to use a state driven camera or an animator
hellu
is there an event I can listen to that fires when the camera has finished lerping to the virtual camera?
i can probably just set a coroutine delay but just wanted to know if there's already an event for it
https://docs.unity3d.com/Packages/com.unity.cinemachine@3.0/manual/CinemachineBrainEvents.html
there are events in the CinemachineCore class you can use. In this particular case CinemachineCore.BlendFinishedEvent.AddListener() but you'll have to upgrade to Cinemachine V3 first.
Thanks man, you're a life saver

is there a way to make virtual camera like follow the player ok so in my game its a fixed camera system new camera postions around the map depending where you are but im curious just like power drill massacre if the virtual camera can stay in the same spot but just look at the player?
example of the kind of system I want
I mean as you saw the camera stayed in the same spot but just looked at the player
i think thats just a "aim at target" camera. body does nothing
ok so you were correct I just had to assign my player to the game object variable in each of the camera
thx
what transposer?
used to adjust the postion of the virtual camera to the the target you assigned to the look at variable I think idk much about it
Hello, i want to be able to switch between 2 free look cameras and keep the crosshair at the same screen coordinates ? i have a simple 3rd person free look camera and another one over the shoulder for the aim situation. The aim camera is pretty much the same as the simple follow but with a tighter fov, but when i aim i find that the crosshair moves a bit on the x and y axis. Did anyone come across this kind of issue before ?
show screenshots?
Sure, of the editor of each or the gameplay scene ?
of the situation you're having trouble with
when i aim i find that the crosshair moves a bit on the x and y axis.
Maybe side by side of aiming/not aiming
Like, your description is a little confusing to me. Is the crosshair not always just in the center of the screen?
Yes, give me a sec, i'll post 2 shots of aim and not with editor of each camera
(full shots of the whole Unity editor are usually best btw)
you mean the gameplay scene with editor at the same time in one shot ?
isn't the "gameplay scene" part of the unity editor
so this red thing is what exactly?
Did you draw that in after? Is that a UI element?
is that what we're worried about?
That's what i aim for, but when i ads the crosshair moves, even though the crosshair is just a ui element in center of the screen, so i am assuming switching the cameras moves its position a bit or am i mistaken ?
ui element in center of the screen
Just to start with first principles here can you show how that's set up?
What kind of canvas are we talking about
and how is the crosshair set up
With cinemachine we're typically not actually changing cameras at all
Only changing virtual camera
yes, sorry that's what i meant, virtual cams, but for the crosshair, its a bit tricky to explain because i change them dynamically based on what kind of weapon i have in hand, but they all keep the same screen coords in the same container (canvas), basically switching on and off some images based on the weapon types
right I want to see how that canvas and UI Image are set up
Maybe worth mentionning though, i sync the input of the free look cams before switching so they end up in the same spot, something like this, maybe that's bad ?
ok so there's this "Basic Crosshair UI" script
what's that do?
is that moving it around?
No, that's just to move the inner parts of the crosshair controlled by an accuracy property, but do not move the hole thing, just jitters a bit the 2 parts inside the corsshair container when you run or something
Something like this, but hte crosshair stays at the center
I just noticed, zooming in by lowering the FOV of the same virtual camera does the same effect, so i am assuming this doesn't have to do with crosshair itself but rather the virtual cameras
well stupid question but if you disable that script does it change anything?
also can you show the inspector of the canvas itself?
Pretty much the same test i just did witch does not involve any crosshair interaction, i dont aim or anything just manually adjust the fov and the camera moves slightly the same as when i aim
Show the parent-most canvas if possible please
I'm interested in the render mode
Sure
ok so it;s screen space overlay
in other words - the camera basically shouldn't be affecting the canvas whatsoever
since overlay canvases just draw directly on the screen
So the issue is with my virtual cams setup right ?
I have no idea lol
based on what you've shown I don't understand why the crosshair would move when you change FOV
the UI shouldn't care about what the camera is doing whatsoever AFAICT
unless you've got something going on in one of those many scripts
Yeah its a bit tricky, but its not a crosshair issue, i mentionned it just because thats how we can see it clearly, but the issue is that when i zoom in (by adjusting the fov) the virtual cam does not keep the point in the world that i had in the screen center at the same position after the fov changes .. not sure how i can fix this but i'll look into it, thanks for your time anyways, much appreciated
After experimenting a bit, i found that the virtual camera with body set on 3rd Person Follow works well when zooming in either by moving the camera distance or adjusting the FOV, so for everyone having the same issue, it seems that the Free look is not meant for accurate 3rd person aim, just switch to a vCam with 3rd person follow 👍
Hey I'm using two cinemachine cameras and I have a button in world space is there a reason why it works on only one camera and not the other?
Graphic raycaster is using the wrong camera? Something that blocks raycasts is between the second camera and the button?
thank you! how can i manually set the camera distance? it wont seem to let me and it kinda messes with my plans
you mean the position of the camera transform?
yeah, it seems to only want to be here, and i cant change it unless i confine the camera, but then the offset kinda breaks with as the camera is still operating as if its still in its original position so the FOV goes too wide
you have to move the virtual camera, not the camera
when i try moving it is stuck in place
Vcams are moved with Body settings, or manually with transform values only if no Body settings are overriding the position
just found it thank you!
Hello, I have again problem with probably cinemachine.
I have a player with rigidbody, animations and two IK with riglayers.
Now I'm confused how this whole character should be set up.
I have two children in this main go. Cameras and Character
GO Character has Rigibody (yes, interpolate). It has children go with eye. This eye is following by cinemachine virtual.
The problem is no matter what I will do, there is still ugly jittering effect (only on camera in playmode, on scene everything seems fine). For example I have a gun in my hand. So this gun will be jittering
Is the IK not up to date with camera move? Or guns? Or what?
Making smart update, late update, fixed update, everything on interpolate, extrapolate not works
the "weapon" vacuum is shaking/jittering once the player start to rotate. Where the gun with IK should be in this hierarchy? Under the player with rigidbody, or under the camera without rigidbody?
anyone know how i can stop the player from being weird and fuzzy around the edges when i move
Your player is likely a rigidbody with interpolation not enabled, so try enabling it
fixed
I would say this is happening because of the view settings, it's popping between a rotation .. i think
yeah but how can I fix that
plus its not really what I want
the fix is to change the view/ angles a bit
I can't be more specific, because I don't know exactly without playing around myself
I want something similar to Furi
where the main character is around the middle of the screen
a little to the bottom
with some variance
So the targetgroup should be part of the player hierarchy, so it moves with it.
You then need to angle your VCam to mimic that image
yeah no its hard to explain its not like this
Increase the weight of your player on the target group
okay so i did this
also this
but I also want it to have some, idk
vertical movement?
like I want it to be kind of like a hemisphere in a way
im not sure how the camera of Furi is done
but getting something similar would be the goal
bump please
What method precisely is rotating the rigidbody here
For example if you're changing a transform rotation directly on a rigidbody, interpolation cannot function
idk man, I'm using with some samples
What I know when i switch to normal camera everything is working
It would be important to know
but even if I will do in other way and make weapon under player with rigid and make camera cinemachine fixed update
i dont get it, how to properly set up a character with animations, IK, weapons and cinemachine
What I discovered, when I created a new virtual for a car view, I deleted the eye following method and everything was working
What eye following method?
"Inheriting RB"? I don't quite understand
Seems like we have only bits of the puzzle
there is GO "Player_hazmat" - its empty
this GO contains two children Cameras and 1st/3rd Character
Cameras dont have RB, it contais main camera and virtuals. In this case I'm using CM Walk
1st/3rd character has RB, Movement from Easy Character Movement 2 (asset), under it there are animator, roots with bones, mesh, IK
if I will keep weapon with cameras, then its ok but characters hands are shaking
if I will move weapon under players hands then hands are ok, but weapon starts to shaking
I can send you a package with this character and scripts if this will help
I can try to look at it
I also use ECM2 so I have a bit of familiarity with it
Oh great, so I'm using their demo with cinemachine
I send you the package on DM
I think the best way will be to keep weapons where is player, not where cameras are in hierarchy. I want to weapon moved with character animations
oh and on main camera I preffer the late update. I see a strange lags using fixed update variants. Even without hands and weapons. It has heavy feels
It's important to learn what fixedupdate is and what it's for
Then it'll be obvious why
its for physic calc like RB
its not every frame like update
so is there any way to keep late update but have a character with rb?
with this whole stuff like anim, ik, weapons
yes, just turn on interpolation on the Rigidbody
LateUpdate cinemachine camera with Rigidbody with interpolation is silky smooth
If it's not for you, something is off about your setup
If you're doing this
that would be why
you're sidestepping anything the RB can interpolate
by manually setting the rotation
then how to set up this with animations, IK and weapons?
I used the simple demo from ECM2 with cinemachine
Move things via the Rigidbody
If you use Rigidbody.MoveRotation, that will be interpolated
if you use velocity or forces and torques
that will be interpolated
these things generally wouldn't be using a Rigidbody
but they are jittering/lagging
the hands IK is slower than camera rotation
I mean, this is what I see, not sure if this is the problem
I think it's more of a timing issue
The second clip shows how drastically choppier uninterpolated fixedupdate movement would be
Don't know how precisely correct ECM2's way of doing rotation is, especially for conserving physics forces, but it does do some type of interpolation as far as I can tell
I must be doing something wrong, but idk what. Its not rocket science, its animations, IK and weapon - thats all
I was putting every combination of children-parent in this character
the best resul is to keep weapons under cameras but its bad way
@errant shard did you received package on private messages?
When teleporting my player my camera zooms out slightly, I have no code that causes this, how do I fix it?
What vcam properties do you have, and also would be nice to see what it looks like in motion
They are all just base properties, it is a cut transition so as soon as I tp it instantly cuts to being zoomed in. I fixed it by decreasing my players pov to 60 and now when I go through my teleport it doesnt zoom in as its already zoomed in before you teleport.
its a work around, so now I can only use 60pov or itll do the zoom thing
Multiple vcams with different FoV values?
We have no knowledge about what your "teleporting" involves exactly
its just moving the players position
Only one vcam
and the brain oc
wait nvm i know what was causing it now
What does it seem like?
I had a portal, and this portals fov was set to 60, so when I went through it with my players camera at an fov of 70ish it looked like it zoomed in.
sometimes just talking about a problem helps you find the answer
Quite so
Still, if you want us here to function as more than rubber ducks you'll want to walk us through the components, properties and methods that are involved
That way we can try to spot issues also
Otherwise the actual problem remains fully in the fog of war to us
yea you are right and I apologize for not sharing screenshots, I was about to if I hadn't of found the problem.
wdym rubber ducks?
ah cool that seems like a good strat
is there a way to make cinemachine ignore multiple tags?
how to make camera dont go thrue objects when they are long?
just try making the objects collider go higher?
ignore what? ignore seeing or ignore colliding?
what do you mean
the problem is that the camera collides with the object and then slides to the top of it, right?
you want it to not go up
I want the camera to not clip through walls but instead zoom in towards the player
isn't it already doing that?
it's zooming but because the wall is not high enough it can see the player
so no need to zoom
as you can see it does but not when player is too close and the object is big
can you show the cinemachine settings
did you try lowering the distance limit value?
How do I change the m.NoiseProfile at runtime?
I know I do:
PlayerVC.GetCinemachineComponent<CinemachineBasicMultiChannelPerlin>().m.NoiseProfile =
But what do I set it equal to? Strings don't work and I don't have a reference to the NoiseSettings thing.
first add a variable as
[SerializeField] NoiseSettings noiseSettings;
Okay, so then what do I set that variable to?
ah thanks that what I needed
just drag the one you want
cool
colliding
not with tag but you can do it with layers
oh ok, thanks for your help!
How would you go about using cinemachine to make a league of legends style camera system for your game? Locked cam follows the player from behind and doesn't rotate left or right, just looks down from above at a 45 degree angle. Unlocked cam holds the same zoom and allows you to move the camera by pushing the edge of the screens. You can press spacebar to recenter on character. Both locked and unlocked allow you to zoom in and out.
Its my 2nd day using unity and I tried to make this system myself. I've gotten pretty close but I think my code is messy and my zoom doesn't work perfect while unlocked cam is on. I made one camera and two virtual cameras for this setup with like 4 scripts.
4 scripts seems very excessive and I wouldn't recommend using cinemachine if you are new to unity
Include all of your logic in one update function in a single script, and decide how the camera is supposed to move based off of its current state
This can be easily controlled with an if statement and a Boolean
I'll try that when I come back to it. I spent 10 hrs trying to figure out cameras I think I'm gonna move on and revisit it when I learn more. It's like 99% functional right now anway lol but I will keep your advice in mind thank you
still no answers 😦 somebody please help me, I'm going insane with thic cinemachine
I'm coming up short here, I am making a game similar to Gravity rush and need a very dynamic feeling camera for this one thing I'm running into is how to wrap around the y axis or coming up with an alternative to doing so, I'm using the freelook camera with the orbital transposer
any resources would be appreciated
What do you mean exactly by "wrap around the y axis"?
instead of say stopping at the 180 degree it keeps going over
it is a weird problem to have and I could be overthinking the solution
Just to elaborate here is a snippet of the game I'm working on
FreeLook is probably not really designed for this
It's designed for a traditional TPS basically
you'll likely need to write some of your own camera code.
do you know if the freelook cam could be reoriented, cuz I have an idea if that's possible
My understanding of FreeLook is that each of the three orbit cameras is a fully fledged virtual camera
and you can configure them however you wish
but the transitioning between them is something that's pretty difficult to change AFAIK, though I'm not sure.
so I might be better of heavily tweaking a virtual cam, I'll look first into changing the orientation of the orbits but I'll keep what you said in mind thanks
one more question is there a way I can set the freelook camera to always have gravity be it's down direction, so the orbits would correspond to the gravity direction rather than world.down
I coincidentally made a camera like that not too long ago actually - it was quite a hassle.
not using cinemachine at all though.
you can have the raw code if you want, though I'm not sure exactly how much you'd learn from my spaghetti code :P
Hey y'all i've got a question i can't seem to elegantly solve if anyone here has any advice.
I've got a scene that is an interior of a room. I'm using a framing transposer camera to try and keep all the players in the room in view at the same time.
The issue is I'm also trying to keep the edges of the room OUT of view of the camera. For example the tops of walls or the outside of the room.
Is there an elegant way to do this? The confiner extension seemed nice but working with a collider box is tough because my room is irregularly shaped. I also have tried the collider extension for the camera and adding a bunch of bounds around the room to manually constrict the camera and this KINDA works but gets really difficult when working in corners and seems like an overall very hacky and inconsistent and time consuming solution that doesn't really cover all scenarios very well.
To me it seems like there should be some way to have a target group that has an exclusion list for example where it keeps certain object out of view, and I could add invisible objects that outline the edge of the room into that list.
Any thoughts on what I could do here? Thanks!
What the room looks like:
Example of a good shot:
Example of a bad shot:
What if you just disable the renderers for the walls which are facing away from the camera?
Yes I think that would be fine for walls obstructing view. But im more concerned about the void showing
I don't want anything outside the room to show. I think classically this is solved by forcing the camera to literally stay inside the room but then I think to get the same framing I would have to dynamically change the FOV, which I don't want to do
If anyone is curious I was able to solve this by picking one shot that contained the full scene, and then i wrote a cinemachine extension that forced the camera to stay within the frustum bounds of that full-scene shot. As a result nothing outside of the full scene shot can ever come into view, but the camera itself can zoom in and move within any part of the shot
Is there a way to tell if the virtual camera I have is a 2D camera? I'm pretty sure I created a 2D camera but when I do screenshake it's moving in the Z axis and rotating
Creating a 2D camera and a VirtualCamera seem to create exactly the same thing
the 2d camera is just a regular camera but not perspective
everything else is the same
did you try selecting different noise profile?
and is that a problem that the camera is rotating?
When my sprites are too close together in the Z axis they sometimes go "behind" each other when I do camera shake
did you set "order in layer" values?
Ok, I had tried to do some stuff with that and I was getting various issues but I think I've found a way that works now
Is there any way to modify/extend the existing cameras like the freelook camera?
I essentially want to be able to set the axis of horizontal rotation something almost like mario galaxy where the camera will match the surface mario is on
Wow can't believe I missed this reply I would really appreciate if you could send your code
Hey is it even possible to use a rigidbody and a freelook camera without letting it result in a jittery effect? (or is it only possible with CharacterController component?)
So long as you don’t make the cam a child of the rigidbody cinemachine can deal with it (follow the rigidbody) smoothly
This is weird because im facing a stutter motion issue if im moving my player (with rigidbody(.velocity)) in fixedupdate.
As far as i know this could be fixed by setting the update mode in the cinemachine brain to fixedupdate but if i do so the sourroundings will not face this jittering issue but the player itself that is followed by the camera will be facing it. I also tried to set the damping to 0 but this wouldn't work as well. (Idk if this helps but here is my player movement script https://pastebin.com/3s38TK17 - would be a pleasure if you could help me or send me articles that are explaining it)
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.