#🎥┃cinemachine
1 messages · Page 1 of 1 (latest)
use a confiner 2d extension
i'm trying to confine my camera to this box, but it doesn't work
i have a cinemachine confiner2d set to a polygon collider2d that is on a different layer
as you can see, it's not being confined
found it
bounding box is smaller then camera, thus i needed to check that option to calculate a bounding box
How do I apply a confiner2D Extension on a camera?
so im trying to make a 3rd person game in unity and i wanted a camera that was somewhat like GTA 5's camera. i tried using a freelook camera but it felt weird, since im not really sure how to explain it well but the camera bounces out when going from top to bottom. i want a camera thats more like GTA or other third person games, so i was wondering if i should use a cinemachine freelook camera, cinemachine virtual camera, or code something myself?
Cinemachine Freelook is pretty much the best. You just need to configure it to your needs.
(btw Freelook is a rig of 3 separate virtual cameras)
Hey I haven't used Cinemachine in a long time and need some help
I am using Track and Dolly but having some problems with the camera moving left or right on its own
is there a way to fix this?
first option 👍
i already tried that and decided to go with another option
any time my man ✅
I am going to ask this again. Is there a fix for the cinemachine camera going off the track? I made a straight line but and it goes left and then right.
also for some reason adding more waypoints moves the camera for seemingly no reason
instead of asking again, show a video of the issue you might get better help. and be descriptive what you tried
Is AutoDolly checked ? can u screenshots settings for cam with expanded sections
you set any offsets or anything like that
yes
try removing offset
try it anyway and see if it stays on path
if it does its issue with offset
it still does it
where is that found?
oh just saw it lol
still does it but not as crazy
I do want it to be a straight line though
you have warning on AIM
maybe you need it
haven't used dolly in a hot minute..
Hello , anyone here have experience on unity timeline and cinamachine ? I want to make my camera shake in for a moment in the timeline. What is the best way to make this
use an Impulse sender / listener
makes it worse, it looks directly at the player from above
So that would need timeline signal right ?
yeah if u can call CinemachineImpulseSource with that yea
https://docs.unity3d.com/Packages/com.unity.cinemachine@2.6/api/Cinemachine.CinemachineImpulseSource.html @ruby dragon just need to call GenerateImpulse
I will check it out
How can I override a virtual camera's position even if it's set to Follow Transposer? It's to implement a screenshake
You can use cinemachine's own perlin noise thing to do the shake
Ik but I've decided to implement my own
Hello. Can u help with path issue pls.
I created the path.
And my car should move on this path.
But when it starts to move it rotates like this
Idk how to fix it
New Question:
Probably a common question but ... i have some scene's i'm using to set up cinematics... and i save off virtual camers from those etc into prefabs... looking to add those prefabs at runtime, but i need a way to 1. inform the cinemachine brain from the current scene that those new vcams exist and 2. set up the blends of the existing camera to know how to cut/transition b/w the newly added cameras
i'm like 99% sure you can add new cameras at runtime and have them work but i'm not having good google-fu today
Ty. I will try tomorrow
- inform the cinemachine brain from the current scene that those new vcams exist
This happens automatically, you don't need to do anything special.
i have to fill you in on what the bug ACTUALLLY was.... this is truly fun and odd.
i had virtual cameras that were on a layer that the main camera's culling mask was omitting
and ... this magically causes cinemachine brain to not switch to a camera who's on a layer being culled by the main camera's culling mask
my script i'd written would have changed the main camera's culling masks tho
so now i gotta jump thru some hoops to fix that up
ODD.
Question : I want my cinemachine follow my initiated object how should I accomplish that??
Cinemachine follow an object easy through inspector but using initiated object (clone) it doesn't help??!!
You reference relevant object and assign target through code. Documentation is pinned here.
Thanks for reply but I'm a newbie and i dont what u mean by reference relevant object??
Rarely use Cinemachine, I'm talking about component that has a target assigned to to follow. You reference it and set target. You can find tutorials explaining how to reference other scripts in any Unity Learn scripting tutorial.
Then access property and set it
The recommended way for cinemachine is to simply include the Cinemachine vCam as part of the instantiated prefab
Thanks alot it worked
Thanks for the reply and ur time found a solution
Is there a better way for me to use the camera like this? im currently using Camera dolly with track and manually placing waypoints. It's very inefficient and not giving good results
nvm
What can I do to make cinemachine feel smooth and responsive using the input system?
Not sure what one has to do with the other?
The only connection between them is if you use a Cinemachine input provider
I am and when you do the sensitivity is completely different. The input is way too sensitive from a mouse and not sensitive from a gamepad
Just allow a sensitivity setting?
My camera is pretty jagged and laggy,anything i can do to fix it?
hows your player moving
Show the settings under "Body" as well
By jagged, do you mean that it seems to move in little discrete jumps? Because I notice that you have the pixel perfect script on there.
yes,i added it because it fixes it. I seemed to have fixed it by adjusting the size of the Grid so it works for now,ill update tommorow since i went to rest for today
Smoothed camera movement with pixel perfect snapping will create jagged/jittery movement, that is mostly unavoidable
Hi, just hoping to seek some advice here in regards to cinemachine, cause i know it uses late update instead of update or fixed, when working with Head Bob with it, should we also set it up to Late update instead of update or fixed update? Btw using a Rigidbody component for character movement.
You should just turn interpolation on for your Rigidbody, and leave the CMBrain on LateUpdate
Would give that a try. Thanks @royal tartan
Can someone please help me make a third person character controller where the, camera follows the player (i already have that done with cinemachine). and where the player uses the mouse/gamepad analogue stick to control rotation
yeah but i already made a script for movement
so whats ur question ?
if i could have help adding in the mouse control for the camera
you mean for rotation with character ? why dont you look at the unity example provided that does just this..?
nevermind i found a unity video on it
Hey guys how would one access the cinemachine extensions on a virtual camera,some of the extensions are missing like recomposer and offset?
Hi
This is the Cinemachine channel.
You can find the documentation and tutorials for it in the pinned messages of this channel
Pinned messages as in?
As in the discord feature, pinned messages
Ok I'm pretty new to discord. Could you tell me where the pinned msgs would be?
Is it there in this group itself?
Ok you mean the ones which have the link. Right
Okie Okie got it no probs.:)
Found it on the top right
I'm happy to be a part of this team
Really am into unity and its various aspects. Am thinking of going forward with this
I'm looking for a way to use cinemachineOffset with a virtual camera that has a follow target.. and get it to be clamped in viewport/screen space so it doesnt go off screen. CinemachineConfiner seems to fit the bill, but it doesnt clamp. Any built in ways to do such a thing?
Hi, is there a way to zoom out using cinemachine with the new input system? I have a mouse wheel input mapped from an Input Action asset to the Z-axis of the Cinemachine Input Provider:
Just trying to have the camera move back and possibly set a max zoom out and in distance
Hello, I am using cinemachine with the URP Pixel perfect camera.
I noticed than when I set "Crop frame" to "none" in the pixel perfect camera settings, my camera size does not match my cinemachine virtual camera size
It causes flicker between the vcam size and the cam size in the editor (no flicker while the game is running)
But Camera.screentoworldpoint returns values according to the actual camera size (that is not matching the vcam size), so the wrong values
Normally, the white (actual camera) outline should match the red (vcam) outline, but that is not the case if I change the orthographic size
That only happens with "crop frame" to "none"
I also have the cinemachine pixel perfect component on my vcam
Okay so I think this is a problem with URP, I'm going to ask there
why do i have to invert my UI/Delta action reference's output
for it to behave correctly with POV and orbital transposer
Hey I asked about this a while ago but my problem didn't get resolved. I am having an issue with Track and Dolly not getting locked to the track
Low res it looks like this
high res it looks like this
so it causes this problem
any help?
Hello everyone ! I never used cinemachine but I'm trying the Starter Assets - Third Person Character Controller (https://assetstore.unity.com/packages/essentials/starter-assets-third-person-character-controller-196526) and there's a cinemachine brain in the MainCamera that makes it constantly move (only a little bit but some people might find it nauseous ...). Obviously, disabling it makes the camera not following anymore. Any idea to remove that movement?
Update method to "Manual update" makes the movement disappear but the camera doesn't follow the character either
Hello! Complete n00b here. Can someone help me understand how to get a properly confined camera position? I have a couple of issues:
-
Currently following a tutorial on a 2d platformer that uses vector art, but I am making the game with pixel art. I am using a script for the camera, but am having a hard time getting the settings right. I want a confined camera like in Celeste. Have tried using cinemachine, but have issues with shooting projectiles hitting the polygon collider, immediately exploding.
-
Another issue I have is that the scene view camera and the game camera are not aligned, making it a hassle to design the level. I am aiming for a 16:9 ratio (320x180), but haven't found a way to align game/scene camera view.
-
When the player enters the next room the camera switches, triggered by an invisible "door". When the player is in "room 2" and the camera did not follow the player remains outside the screen, in other words the camera does not update/switch with the player, only when triggered.
I hope I made sense. Any help would be a huge relief, as I have been stuck on this for some days and it's constantly bothering me. Swimming in tutorials not finding any answers!
Currently following a tutorial on a 2d platformer that uses vector art, but I am making the game with pixel art. I am using a script for the camera, but am having a hard time getting the settings right. I want a confined camera like in Celeste. Have tried using cinemachine, but have issues with shooting projectiles hitting the polygon collider, immediately exploding.
Use layer based collision to ensure that the collider doesn't interact with anything in the game itself and is only used for your cinemachine purpose
Another issue I have is that the scene view camera and the game camera are not aligned, making it a hassle to design the level. I am aiming for a 16:9 ratio (320x180), but haven't found a way to align game/scene camera view.
You can set your game view to any resolution you want, and should do so to make sure your game looks good at the resolution you're targetting. (press the button at the top of the Game window that says "Free Aspect" or some resolution to change it)
- When the player enters the next room the camera switches, triggered by an invisible "door". When the player is in "room 2" and the camera did not follow the player remains outside the screen, in other words the camera does not update/switch with the player, only when triggered.
You should switch cinemachine virtual cameras by modifying the priority of the vCams or by enabling/disabling them
Hi. I am making 2d game and I'm using Cinemachine to control camera but vcamera is changing z axis of the camera and it just breaks the game also when I try to use noise to create shake effect, it changes z axis too, how can I lock z axis or something like this ?
cinemachine is extremely configurable and there are many different follow components that will not result in the camera's z axis changing
so can you show me one ?
because I'm new to cinemachine
Cinemachine brain allows the real camera to be controlled by virtual cameras; you don't need to touch it
The swaying motion is "noise" which is defined in the virtual camera's settings
Damn, you're the MVP 🙂 You've spared me hours of research haha Thanks a lot, it works as I want it to now 🙂
In this video I will show fellow Unity Developers or aspiring Game Developers how to zoom in and out with cinemachine.
💖 Support my videos on Patreon ► https://www.patreon.com/obsessivegames
▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
🙋 LINKS TO CHECK OUT 💗
If you need any assets and would like to see what the Unity asset store has to offer, then head right to...
https://docs.unity3d.com/Packages/com.unity.cinemachine@2.8/manual/index.html I recommend taking a look at this
It's well written and incredibly helpful
Is there a way to override the Up direction of the camera?
I have a situation where the player does not always move around on a platform that is orientated with the world up, the player's up might be right instead as an example.
The issue is by doing this the player is skew in the camera, whereas I want the camera up to align with the player's up.
Use one of those modes that doesn't force world up
Thanks for the reply, I tried but with the movement I had setup it was causing strange movements as lock to target will cause the camera to jitter rotate when the character rotates, but I ended up creating a camera movement similar to the free look using the basic virtual camera and I have more control now.
Is Screen - Space camera ok for healthbars? it looks like it lags behind movement
On Overlay it does not happens
Is it possible to fix it?
i`m already updating healthbar positions on LateUpdate() and it does not happen with canvas Overlay but i really need screen space canvas
Is it not possible?
u might need to change your script order to happen before cinemachine
i think someone had that issue a while ago
even without cinemachine it happens
hey if I'm trying to write a parallaxing script, and Im using cinemachine, should I use the main camera as my reference or the active cinemachine camera?
main
hello, how can I adjust the camera acceleration on cinemachine?
I am trying to make a basic TPS game and found out that cinemachine is a quite useful tool but I couldn't figure out how I can stop the camera lagging behind when the movement is starting
Reduce damping values
Virtual camera body should have settings for it
The problem is the screen space camera keeping updating position but it is lagging behind the scrollbar position script
Is there any way to fix it?
can i force screen space camera to update?
Hello, is there any way to switch between two virtual cameras whilst Time.timeScale = 0? I want to make the camera switch such as in shovel knight or celeste where the player can't move while switching camera and the all objects start moving right when the camera has fully switched.
See ignore time scale?
the transition between the two cameras still pause
hey guys
I need to make the camera to warp with the player instantly (instead of the very long and fast ease-in)
Camera.main.GetComponent<CinemachineBrain>().ActiveVirtualCamera.OnTargetObjectWarped(transform, point - transform.position); is this the right way to do that ?
oh, I was just calling it too late, that's why it had no effect, nvm
If you don’t mind me asking, how’d you achieve this type of movement, I love it
Thank you! Its essentially an active ragdoll anchored to a character controller. It allows for the tighter controls you get with a standard character controller, while also having a ragdoll like effect.
Hi, I'm still not sure how to Time.timeScale = 0 so that the game stops whilst transitioning between two virtual cameras, the ignore time scale doesn't work properly since the cameras don't end up finishing their transition.
Hello im using the unity version 2021.2.10f1 but i cant install cinemachine 2.8.6 it keeps calling :[Package Manager Window] Error adding package: com.unity.cinemachine@2.8.6.
UnityEditor.EditorApplication:Internal_CallUpdateFunctions ()
Would you be able to point me in the direction of a tutorial for this 😅
Hey, how do i get my pixel perfect cinemachine to stay on the same scale/zoom level when changing resolutions?
Hey guys got a problem with cinemachine. I cant Move my character where the camera is looking at.
Is there any setting that can move my character with my camera?
It has nothing to do with Cinemachine. It has to do with your movement script
Do you have a way of doing that/fixing that then?
yeah, adjust your input based on the camera's rotation.
depends what you want exactly
you might want to also "flatten" it so the angle of the camera looking down doesn't affect it
im using character controller so let me get the
Vector3 horizontalvelocty = (transform.right * Controlinput.x + transform.forward * Controlinput.y) * Movespeed;
charcon.Move(horizontalvelocty * Time.deltaTime);
Does the transform.forward the Camera Input?
depends which object this script is on
it's whatever object the script is attached to
how do i stop my camera from doing flips?
how can i change transpoer and composer to do nothing in script
the simplest way is to have two different virtual cameras and just switch between them
that's how you should do 90% of changes in camera behavior in cinemachine
it looks fine you just have your game view zoomed in weirdly
Also you're using a perspective camera for 2D, which is why your player looks weirdly large (that also means your player is closer to the camera than everything else for some reason)
wierd, cuz its on the same z layer
alright thank you, i swapped to ortho and got everything working again, i must've fat fingered some stuff and messed it up somehow
So I have simple setup for my online player. On first time only, when i switch between first person and third person cameras, I got effect of camera rotating (as I have dampening on first person camera). For some reason it does not get previous camera pitch or yawn and rotates to its position. Inherit position does not help at all. The weirdest part, after first switch is complete, i can switch as many times as I want and everything works.
Third person camera: 3person follow
First person camera: transposer with aim to player camera root. which I am rotating with scripts after.
In case, the camera root object rotation and coordinations does not change between switches. My only idea is that Dampening takes start values of first person camera and tries to dampening it to data it got when switching. and after first switch for some reason it get data correctly
Order of disabling and enabling cameras does not effect anything..
I tried to set it manually on enable, but i know how to get third person camera data.
_camera.GetCinemachineComponent<CinemachineOrbitalTransposer>();
vcamOrbitalTransposer.m_Heading.m_Bias
but have no idea where to get first person camera as it is different component. <CinemachineTransposer> type
Hey guys, I have an issue with Cinemachine in my 2D game where my enemy sprite is jittering when moving. I fixed my player sprite's jitters by setting the Brain to Fixed Update on the blend update method, but I can't seem to figure out my enemy's issue. I tried Interpolate and the Pixel Perfect extension and neither of those seems to fix it. Any other ideas?
When in the frame are you moving the enemy sprite?
FixedUpdate
You probably shouldn't be.
Fixed update isn't really meant for stuff that should be happening 1/frame
okay. its also worth noting the jittering stops when my CineMachine Brain is off, thats why i think its not to do with the code
changing around the Update method didnt seem to work
Is there a way to remove the cinemachine ui indicator that shows the camera region
uncheck the "game window guides" checkbox on the vCam
hey, im using a camera blend, and it always does this motion during transitions. is there a way to adjust this?
Looking for some help on an issue i'm having with cinemachine for a beat 'em up style game
i'm using a Cinemachine Path and a virtual camera with the body set to "Tracked Dolly" with said path
Auto dolly enabled
here's the path
Here's a video of the issue:
If i move the player above the path, it does what I'd like it to do, whereas if I move the player under the path, you'll see it "jumps" and the movement is not continuous
my assumption is that it's trying to find the closest point on the path, and it snaps at a certain boundary
not sure what a solution might be though 🤔
Make video mp4 it don’t work on my phone
Ok fine machine hat does it do? I’m kind of new to unity
Well it really been using it for years but I’ve never used cunemaxhin
*cinemachine
Hi, I have two cameras. One renders the background and another renders the foreground. Both have a brain and are pointing to a virtual camera (I have a system in place that allows switching cameras)
I started having a problem because the background camera has a background layer (so that it only renders the background stuff) where the virtual camera didn't work (the brain wasn't catching it due to being a different layer). To solve this, I paired the background camera to the main camera
The problem is that now camera shaking looks bad because the background doesn't shake given it is parented and so the background simply follows the shaking.
I think I'm not doing this in the right way. What I wanted was for both Cameras to use the same virtual camera. Is there another way to do this?
(I'm using a background Layer to fake objects that are very far away. Kind of like a dynamic skybox)
Ok, solved it by adding Virtual Cameras to a VirtualCamera layer that is shared by both cameras (if anyone needs this=
HOE TO GET CAMERA FORWARD DIR IN CINEMACHINE?
How to get the virtual camera real transform?
I actually wanna add some code when the virtual camera face in diff direction
AFAIK, it's just accessing the VCam transform. Is it not working for you?
Usually I don't even bother with the vCams and just use the actual main camera Transform. Unless you need the vCam's data while it's not live for some reason
Cinemachine sucks, don't use it
How can I access all the children in my blend list via C#?
Not totally sure about the math but you can implement custom input for those things by making a script that implements Cinemachine.AxisState.IInputAxisProvider and attaching it to the same GameObject as your POV vCam
The goal here is that as you move your finger, the point at which your finger is touching the virtual ball on the ball never changes right?
Say the sphere was a globe and you put your finger on London, as you swipe around your finger should never leave London?
I think I could work out the math (or at least the code) with a little tinkering...
I don't think you'd need much more than some raycasting (against sphere collider), transform.InverseTransformPoint, and Quaternion.FromToRotation
Yeah it really is. Also, even in my globe example, it's not a well defined thing, because even with London under your finger there's still a full 360 degrees of rotation the sphere could have around your finger as an axis, all of which would be valid orientations for the sphere
Yeah to control when to switch to the next camera?
Ah ok. I would like to immediately blend to the next camera in the list.
And have an option to pause executing instructions.
Do you guys know why when I rotate my follow target for my virtual camera (it's set to 3rd person follow) on the x-axis, it rotates the camera around itself , not the target?
Hi ! I'm using the Starter Asset Pack controller with a Virtual Camera (by default), but on Desktop, the Look Around camera with the mouse is limited by the screen size and in Unity it's like in 360 degrees by just moving the cursor all the way on the left or right. Is there a way to have the same settings when the build is exported (in WebGL)? I don't know if it's clear..
dear all, I get a task , creating a human walking and fall in a room, how should I start to learn ? time is limited. Thanks
can someone explain what the difference is between these? it seems they both do the same thing, but opposite from each other
like; isn't setting collide against default ticked the same as setting transparent layers default unticked??
Collide against would be things the camera actually collides with.
Transparent layers are things the camera acts as if it can see through
That means it's still the same thing?? Adding a "windows" layer to transparent does the same as removing it from collide against, so unless there's some hidden functionality behind it, i don't understand the point of having both
I don't understand the significant difference either
Cinemachine Collider considers GameObjects in these layers to be potential obstacles. It ignores GameObjects that are not in the selected layers.```
```Transparent Layers
Objects on these layers will never obstruct the view of the target.```
I guess it's just whitelisting vs blacklisting
Could be useful to use either for runtime overriding, but still feels like that might be missing the intended purpose
So if im reading the Cinemachine docs correctly, if i want to use "Same as follow target" for the aim property, i have to rotate my player object in order to look around?
as in, if i want to look around, i have to tie my characters rotation to my mouse
it means the camera will follow the same rotation as the object it's following
It doesn't really care if or how that object rotates, but it will copy that rotation
so if i wanna look around i have to physically rotate my character
if you use that mode, and your follow target is your character, yes.
Thank you. watching now.
okay i see, thanks
i think it's better to use POV then
okay, so i got the CMCam to be the same feel i had with the regular cam
only thing i gotta figure out with the "Feel" is that it kinda jitters when it comes to microscopic movements
when i zoom it my aim kinda "clips" in increments, so i can get my reticle to be smack in the center of the target
it seems that i only get that "smooth" feeling when i set aim speed to maxspeed instead of input value gain, but only when i use really small number
idk, i feel like in triple A games aiming, even when unzoomed, is smoother than it is in my game
like obviously a solution would be that when zoomed in, change the sensitivity, but i feel like i should be able to make microscopic movements even while unzoomed... maybe i need to make a script where the sensitivity is dynamic or something
or maybe that's where the MaxSpeed mode comes in
does any one happens to have a project, where it shows a person walk in a room, and fall down ? I'm happy to pay some bucks for it. I'm cramming for some homework. but do not have a starting point.
i think that violates the academic integrity of your school, surely
we can't do your homework, but we can sure help guide ya, what are you trying to do? just make a video where a person walks into a room and falls over??
Yes. that's my starting point. I'm cramming coursera videos this weekend. but need show something next Tuesday morning. Is there a repo that I can use? to start to build?
Thanks for reply. and guide me. Carby
The most i can do for you is say to have a look in the asset store
which website ?
if you're trying to become a programmer, googling is one of the best skills you can have
but, here:
this all seems unrealted to cinemachine tho
unless you're trying to use that for a cinematic
I am a programmer, I use python daily.
C# is new to me, but I have a book on table.
then it's more important for ya to sharpen your google skillz! better late than never
also, are you going to use cinemachine, or no? @signal cairn
Timeline is what others suggested,
but they say, cinemachine is too much for me.
overkill
if all you gotta do i make a video where a dood walks into a room and falls over, yeah cinemachine isn't needed
OK, got it. thanks.
This same issue has been bothering me, though I haven't had time to look into it
Please let me know if you find out what causes it ^^
You either need to make a scripted that decreases sensitivity as you zoom in, or you could take the time to mess with the speed on "MaxSpeed" mode
how do i have a vertical offset on a deadzone?
how do i get my cinemachine virtual camera to rotate around my player desipte the constraints? I have a third person follow body and do nothing aim set righ tnow
So I'm struggling to get a topdown camera set up for my game. But with a lot of messing around, I got it to look (almost) straight down at the player using world up. However, it is rotated the wrong way (Character is facing up when I need them to face right) how do I do that. I cannot find a rotation from the world up that gets what I need
camera.rotation = Quaternion.LookRotation(Vector3.down, Vector3.forward); for example
change the second parameter as desired to change the "up" direction of your camera
I know I'm really ignorant about cinemachine, but I thought cinemachine would overwrite any code affecting the camera directly?
oh sorry i didn't realize which channel I was in lol
Ah thats fine
I end up may making my own since it is a really basic camera, but I wanted to learn nonetheless
I was able to do it with these settings
You can freely change the transform's y rotation to rotate it however you wish
Oh you can allso use the Dutch setting in the lens to rotate it
Ah actually this works better
use hard look at or composer and dutch
or composer
Ah, that seems to work well, Thanks a lot!
Hello, I'm new to the cinemachine thingy, recomended by someone in #archived-code-general . What would I do to make the camera follow the player and orbit around him left and right when pressing Q and E?
Hello, I am using "Framing Transposer" in the Body and "POV" in the Aim of the camera and it works pretty well.
Thank you for the hint
hello ive got this strange problem which i cant seem to find a fix online for, im using cinemachine free look camera with the new input system, and looking around with the mouse is super jittery whilst looking around with gamepad stick is very smooth (pay attention to the active input device on the right and how jittery the view is when on mouse). any ideas?
how did you hook up the input handling?
using the cinemachine input provider thing
so here's the issue:
Mouse input is framerate independent, and the joystick is framerate dependent. Meaning the code that handles input from both of those devices will always have an issue
joystick input needs to be adjusted for deltaTime, mouse input does not. And the input provider has no way of knowing which is being used
you may have to do something a little custom in order to support both on one input action
ah so do i need my own script to sort that out?
then just provide values to the "input axis value" in the cinemachine thing
ill give that a try, thank you
im now setting mouse input value through script (without delta time) and its still the same
however with time.smoothdeltatime it looks okay but im not entirely sure
why my character is shaking when i move it? im added cinemachine to project and i set x damping to 2. and when i play, its shaking little bit, is there a solution for this?
Either the character or the camera is updating its position in FixedUpdate while the other is in Update or LateUpdate
The VCam's update mode should probably be "smart update" and if the character has a rigidbody, enable Interpolation
I have a transform that has the position and direction that the camera should have (3rd person prespective). If I set it as a VCam with no settings, it works just as intended. Now, I want to add some dampening to it so it doesn't look so stiff. I tried creating another VCam and using this transform as a follow/look at thing. I want it to do the same as that Transform just with some dampening
However, any setting I use doesn't work. What is the right combo of settings?
It seems like a bug because although my transform is like 500m away from the origin, the camera sits randomly at the origin for most settings
Should just be a transposer with some damping
Hello? I want to have 2 Input Axis Names and separate values. One for moving horizontally with game pad stick and the other moves slightly horizontally when you move to the right or left. How can I do that?
Hello, i'm using cinemachine and when the player jumps the camera also jumps with him which looks weird how can i make it not jump i tried messing with the values but couldn't find a solution
have cinemachine follow an object that follows the player on the horizontal axis(es) but doesn't jump with it.
iam using an empty game object for the look
ok but sounds like your empty object is jumping with the player
yes
ah i get you but how do i make it not jump
I recommend an object with https://docs.unity3d.com/Manual/class-PositionConstraint.html that is NOT the player's child
and just have it follow the player on only the x/z axes, not the y
The problem wasn't the "look at" it was the "follow" thanks for the help it worked i changed follow from player to the empty gameobject with the position constraint component
thanks again
how can i make the camera bit behind the player and make it so like i can see the player capsule full body
i am making a 3d 3rd person game so i am using a free look camera from cinemachine and i have a respawn feature in place but for some reason when i have the free look camera i cant fall so my respawn feature wont work and idk how to fix
Hello, i have a slight problem that annoys me very much. As you can see i have two different camera views and when i switch to the first one it goes smoothly. But when i switch back it stutters a little. I can't figure out the problem.
Any idea why it feels so jaggy
it appears laggy and as if the camera wasnt following smoothly when looking at the ladders
i'm triggering a camera change in code, where i set the follow target of the new camera to the player object as part of that change. This all works fine and good, however, there's some unexplained behaviour that i can't wrap my head around.
the camera follows the wrong point in space until i let go of the movement keys.
it knows what point it should be following, the gizmos properly highlight all that, and yet, it maintains an incorrect shot
to be 100% clear - i do not directly edit any camera's transform or offsets or anything in code. I only change their priorities and follow targets
are there any known issues right now with changing follow targets?
Does anyone know how to snap a camera to its virtual camera state? I'm adding a FOV/distance slider but the change is delayed.
You may need to use vcam.GetCinemachineComponent for specific parts of a vcam
how are you changing the fov/distance? Unless there's a transition between vCams happening, it should be instant.
You can cache a CinemachineComponent just like any component
has anyone created class inheriting from CinemachineExtension and changed the position in PostPipelineStageCallback ? I'm having many issues with it but can't figure out why
hi... I am not sure my question should be here but it is about cameras,
but i am getting this....some of the arm is getting cut... I am trying to make things work by using the near clip plane but it is not working.
also I want the camera to be in the head of the character without seeing it from the inside... HOW CAN I DO THAT?
THANK YOU
Decrease near clip plane so it doesn't cut off, and don't have a model for the character's own head
or
Render the viewmodels using a separate camera using culling masks (or whatever is the recommended way of rendering viewmodels for your render pipeline)
oh I understand
thank you
Oh yeah. I worked it out. It was the damping on the framing transposer, so I just set it to zero and restore it on the next frame.
Does anyone know how to select write a dynamic style for cinemachine blending:
currently doing this
would like to do this
hey can somone help
When I have the scene open, my camera starts in the right position, but when I click play it starts in the wrong spot
The brain moves to the active virtual camera
Are you moving that camera, or using a follow camera?
@candid hare
hey so I fixed it but now I have a new problem
oh wait this is the wrong place oops
I'm following a tutorial, but I want my camera to start facing the back of my player, but I don't know how
anyone here
Hello, I cannot get my camera to follow the player. I created a vcam and added the player GameObject but the camera is still not moving.
UPDATE: I made new versions in 60 fps! :)
Day version: https://youtu.be/qnnmCmtmfT0
Night version: https://youtu.be/ASR8hud15TI
Welcome to Episode 3 of Katzenwagen TV's GTA Road Trip series!
Firstly, sorry for the delayed upload. I had a fever last night... :3
In this episode, we take a tour of the first San Andreas in GTA: San Andreas :)
An...
anyone have any tips on how to create a GTA like vehicle camera
that follows the back of the car, but in a more relaxed manner
how do i add post processing to my cinemachine camera
its not there
which camera have you tried?
How can i make a FreeLook camera instantly follow the player? it lags behind it (set LookAt and Follow to the same prefab) which causes the camera angle to tilt a bit to the left/right when moving left/right
set the damping to 0
i suppose this is a common problem? do u know how to fix it?
You need to use the cinemachine input provider
https://docs.unity3d.com/Packages/com.unity.cinemachine@2.9/manual/CinemachineAlternativeInput.html
Are virtual cameras an actual camera, or they are just gizmos that are holding the position reference?
Just the position and other info
I recommend you read at least the first few pages of documentation
https://docs.unity3d.com/Packages/com.unity.cinemachine@latest
Cinemachine becomes much easier to work with once you understand what the fundamentals of the system are
Is there no way to animate a virtuall camera by itself in the Timeline?
can I just add an animator to the virtual camera and then add an animation track?
I am using Framing Transposer and Group Composer for a third person lock on camera. It has been doing pretty great! But when the follow and the look at targets get to close, the camera constantly rotates to try and keep them in the target positions.
Is there a tutorial anyone knows to combat this? Thank you!
can someone explain why the cinemachine camera is snapping so much?
I added a normal third person mode and lock-strafing to The Kiwi Coder's Third Person Tutorial as I found it kinda stiff and wanted to work from that
But it's been really stiff especially with keyboard movement
The model itself is snapping from lack of proper animation blending and I'm aware but is there anything I can do for the camera snapping
im trying to to install cinemachine but keep hitting these errors
Restart Unity
i checked apple permisions, restarted unity, restarted my mac same issue
im using unity 2020.1.11f1
could it be that im trying to use a to new package?
tried to install 2.5.0 same error
So right now I'm trying to make my camera pixel perfect and no matter what I've done it ends up with the camera going way out of bounds and then these error messages
I have the extension on the virtual camera and the component on the main camera
Ok now I figured that out but I can't see any rendered lines and any code that takes the mouse position is incredibly janky.
I’m really confused since idk if it’s just something I did since I don’t see anything else about it anywhere 😞
Hey, Im having this problem with my POV Cam. When I fly around and then activate my pov cam everything works fine. But when I fly downwards the POV thing isjust buggy. I think it has to do something with global and local orientation. The POV Cam orietates global but this doesnt work for me because I want it to rotate local to the SpaceShip. How can I do this?
(The first thing is my normal Spaceship movement. But at second 2 I activated my POV Cam. At second 7 I deactivated it and at 14 i activated it again. And this is the timestamp where my problem shows up.)
hi, i've got a video-related problem. I am making an FMV game and the system I have in place to load and play videos seems to break once the game is compiled. I use a url-based system that loads the file directly from "Assets/Resources/file.mp4". Why does compiling break this system and how can I fix it?
Anyone Ideas on how to fix this?
Hey !
Is it possible to change the shape of the Free Look Camera ? I would like to use an oval instead of a circle for each rig.
Thanks
oval seems to be more similar to circle, that why I'm asking for this kind of shape, but a more complex closed shape would be better
Actually, I found a solution. my Follow target is following a path (from 0 to 1) depending on m_XAxis.Value (from 0 to 360). It's doing the job for every shape. But if there was a generic solution, I would be happy.
[SerializeField] CinemachineVirtualCamera cameraplayer1unit1;
[SerializeField] CinemachineVirtualCamera cameraplayer1unit2;
[SerializeField] CinemachineVirtualCamera cameraplayer1unit3;
[SerializeField] CinemachineVirtualCamera cameraplayer2unit1;
[SerializeField] CinemachineVirtualCamera cameraplayer2unit2;
[SerializeField] CinemachineVirtualCamera cameraplayer2unit3;
[SerializeField] CinemachineVirtualCamera cameraplayer3unit1;
[SerializeField] CinemachineVirtualCamera cameraplayer3unit2;
[SerializeField] CinemachineVirtualCamera cameraplayer3unit3;
[SerializeField] CinemachineVirtualCamera cameraplayer4unit1;
[SerializeField] CinemachineVirtualCamera cameraplayer4unit2;
[SerializeField] CinemachineVirtualCamera cameraplayer4unit3;
how can i set these up in like a array ?
im checking if a value is == then im setting all other cameras priority to 0 and the one i want to 1
but the code will be 1000 lines if i can compile it
ChinemachineVirtualCamera[] cameras;
cameras[pickYourIndex].doStuff
Cinemachine, you need to setup properties correctly though
im following a tutorial for 3d person movement and camera and when i import cinemachine the tab at the top where i can select the type isnt poping up for me. anyone know why
You could also just use the Plus sign to add a new Cinemachine type
So in my editor I have the ortho size set to 5.5, but when I enter play mode, it zooms in in the game window and changes the ortho size in the main camera
And I'm not really sure why it's happening
Pixel Perfect Camera component's job is to override ortho size to make it fit the pixel scale perfectly
Ideal ortho size is calculated from Asset Pixels Per Unit and Reference Resolution
And game window size iirc
What version of Unity and Cinemachine are you using? I have been learning fairly recent versions with HDRP and Volume processing, but it has changed based on render pipeline and versions so you have to get the right instructions for the right version you are using.
Have you tried the Edit/Sign In menu item? Or opened package manager and refreshed the list of modules? I think its looking for updates but thinks you are not logged on.
im not sure how can i check
So im having this problem with cinemachine where i switch from a third person camera to a targeting camera, back to third person camera, and when I wave my cursor around it causes the third person camera to spazz out. This does not happen when I never switch to the targeting camera, only after. Anyone got a solution for this?
The Unity version is generally in the title bar.
For more recent versions of Unity, you then open the Package Manager window and it shows the versions of packages loaded (its changed around a bit between releases). For me, under "Packages: In project" selected, it shows the version of Cinemachine I am running.
@odd arch Depending whether you use the built-in render pipeline, URP or HDRP, you would install post processing specific to that pipeline, using instructions pinned in #💥┃post-processing
It'll work with cinemachine just by doing that, but if you need to give virtual cameras control over the PP overrides you'll additionally need either of these vcam extensions to match the post processing system
https://docs.unity3d.com/Packages/com.unity.cinemachine@2.9/manual/CinemachinePostProcessing.html
https://docs.unity3d.com/Packages/com.unity.cinemachine@2.9/manual/CinemachineVolumeSettings.html
i need to make that "curved" thing in blender
but idk how
is there a tool like a knife or smtg
i got it
not a blender discord.
trying to teleport the player, but cinemachine does damping during this transition.
i found this discussion where they talk about a fix for this, however I can't get it just right.
https://forum.unity.com/threads/reposition-target-and-camera-runtime-how-to-avoid-the-popping.514293/
for this method, what should the input be?
is transform = vcam follow target, or the thing that got teleported, ex. player rigidbody?
and for position delta, is it the vcam default offset value or?
is transform = vcam follow target, or the thing that got teleported, ex. player rigidbody?
I'd assume those are the same thing, no?
If you're not following the thing that got teleported, you wouldn't be in this mess?
positionDelta is newPosition - oldPosition for the target object.
so target = FollowTarget from vcam, and positionDelta value should be the position value of FollowTarget before the teleport?
- yes
- no did you read what I said?
^
as the docs say "the amount the target's position changed"
i'm brainfarting lol
so lets say current transform of camera is 100, 0, 0 before teleport.
teleport destination got tansform value 0, 0, 0.
would it look something like newPos (0,0,0) - oldPos(100,0,0) then?
think i got it working, i get position before teleport, then multiply that vector value by -1, and use this as positionDelta
it's literally just newPos - oldPos as I said before
multiplying the old position by -1 will work only if the new position is (0,0,0), and because that's literally the same thing :
diff = newPos - oldPos
diff = (0, 0, 0) - oldPos
diff = -oldPos```
i dont know what this means. whatever i try, except for multiply by -1, results in the camera popping / giving incorrect results
It means exactly what it says. Assuming you have the two Vector3 positions:
oldPos - the object's position before the teleport
newPos - the object's position after the teleport
Then the positionDelta can be computed as newPos - oldPos
alright, now i follow i think.
did a new test and seems to be working.
i get Pos of target before teleport as well as Pos of destination. then subtract posOld with posNew, then multiply this value by -1 which results in the delta value.
you shouldn't need to multiply by -1
if you do, you're doing the subtraction in the wrong order
Any help would be greatly appreciated: I have a 2d side scroller game. I am trying to go from room to room (each room can be a different shape and size and their are doors between the rooms). Currently I have scripts that readjust a confiner upon entering each room and it works perfectly. Problems start when the confiner actually changes size rather than just position the camera starts behaving funny. when I hit an edge the whole camera bounces inwards and won't move until I walk back more center in the room. Any ideas why this would happen when changing the confiner position and size?
It's worth noting, as long as the rooms don't change size it works perfectly. The confiner just gets set to the position of the new room and the camera moves into it.
im want to lock the cameras rotation from turning left and right but i don't know how to do it
show settings of Body for virtual camera
iirc LookAt might be the one rotating tho
I am currenyl use cinemachine and a script to make a camera move around an object
is there any way to use some dead zone to it to keep the preventing the camera going back and forth all the time?
and my script
vcam.transform.RotateAround(lastBlock.transform.position, Vector3.up, rotateSpeed * Time.deltaTime);
I figured out my issue above. Not sure if it's the best solution, but I just made it delete the old confiner and create a new one upon entering a new room instead of moving/resizing. Works great now. No camera weirdness.
Hello guys, can someone give me a tip! I would like to transitioning betweek a camera that is targeted on an object (a pirate ship in this case) to a track doll
It is targeting the ship from behind, and then at a certain moment in the timeline it will transpose through a track doll that floats in the air
disable and enable between VM cameras it should blend between them
I cant understand correctly, can I put the example here?
Does anyone know some good tutorials on tracking two players via cinemachine targetgroup?
I've got one set up but the players keep drifting out of view .
The package's importable examples may have something to help with that
Usually the first place I'd look
how do i make my dolly track thing to start playing upon game start?
i feel like i'm missing some obvious part of the docs of how to.... start it, play it, activate it, something
it's all set up, but now/where do i press play during game
ok so apparently what i was missing was that cinemachine doesnt play itself, it needs to be animated or such
Thanks, I'll play around with it
okkkkkk and apparently dolly tracks only do movement, not rotation/angle 🤔
as long as both players are in the target group and the weights are set properly, it should work
And the camera is using the target group as its look target
Thats what I thought but the player can wander out of view. I've increased the radius and that has helped bring it in
dolly track Roll doesnt seem to do much to the camera, all it seems to do is show a cool skewed green track in the editor. My camera stays straight on track and does not roll
my rant for the days' frustrations #💻┃unity-talk message
When you say "transition", do you mean you want the camera to jump from one to the other instantly, or you want one to move from one to the other (over say a second or two)? I use Timeline normally to do the transitions - you can have a Cinemachine track, drop the virtual cameras into it as clips, and blend between them. If you don't want to use Timeline, I am sure you can do the same thing programatically. But its not 100% clear what you want the transition to be. A jump does not need the blend magic - you just have two cinemachine virtual cameras for the two positions, then keep the one you want to use enabled and the other disabled (as said above).
When using State Driven Camera is there an event I can listen to for when the blend transition has been completed?
Hi all, I'm trying to use a cinemachine camera to orbit my player in a roll a ball project I'm making (original I know!)
But I can't seem to find the right combination of camera type & settings that works
IE:
Does not rotate with the ball.
Does not rotate around the orbit without input
So far my best result has been with the Freelook setup using Simple Follow With World Up as the binding mode but this has the issue of rotating around the orbit without camera input (aka when my player moves)
Eventually I want to be able to move the ball relative to where the CM camera is facing and to be able to control where it's facing but that's very difficult when the camera moves by itself.
Anybody know a way to store this as a variable? I have tried more ways than stars in space.
That's just a Transform reference
but can you clarify what you're asking?
Are you asking about the brain's live camera?
Or are you asking about just storing a virtual camera in a variable?
sure! basically i have a movement script where the movement is based off of the camera transform. When the player moves far enough the camera will transition to another camera, but the movement is still based off of the old camera, so all i need to be able to reference the currently active camera so i can change the desired movement based off of the current camera
Just reference the actual camera
how
public Transform myCamera;```
drag and drop the camera into there
done
all the different cinemachine virtual cameras just move the real camera
but it's always the real camera which you're seeing from
OK, think I've done it by changing binding mode to World Space and heading definition to Target Forward
It still rotates a bit when the ball collides, if anyone can help with that, it'd be much appreciated
hi i wanna rotate the cinemachine when mouse right button drag.
Then make a script that rotates it OnMouseDrag() or a function like that
Any suggestions for how to snap to target object via code?
I know I could use the object transform and then offset that
I was wondering if I can utilize the LookAt property
snap to it in terms of pointing the camera to it? Or moving the camera to it?
Ah so, both.
let's say this is the current position
this would be the desired position
So essentially a code that offsets the cinemachine camera at the specific distance and position from
the object
I have some idea of what I need to do, but I was wondering if there is anything out of the box
like Look At or Follow properties that can be utilized
Look at is to turn camera towards the look at target (with lots of damping options). Follow keeps the camera at a fixed offset from the follow target. So yes, they are what you need I think. No code required.
There's no need to write any code for this
that's the point of Cinemachine
it does this for you
How would I go about getting the FOV from a CinemachineVirtualCameraBase within a script?
I don't need to set it I just need to be able to get it
and i cant enable the camera at this point in the code and then read it from the camera it's affecting
also are there performance implications of having a lot of disabled virtual cameras in a scene
It's in the lens settings
yeah but how do I get that
from a cinemachinevirtualcamerabase
this is what im using temporarily
in the base variant?
Is there not one on the base?
yeah I didn't see it
Try it
Guess not then
yeah its really strange
What's the use case
idk why not every CinemachineVirtualCameraBase would have a LensSettings
i have a camera stack
and the other field of view isnt matching the one it inherits
so i wrote a script to copy it for a length of time
when I switch cameras
Probably because it doesn't make sense for a bunch of them
maybe
but I need to check if its even changing in the first place so the call isnt redundant
like yeah I could just do it every time but idk
seems wasteful
I don't fully understand your issue but
Could it just be solved with more virtual cameras
Preconfigured as you need
its just that I dont want to lock my options behind only using CinemachineVirtualCameras
I probably will only use them though
maybe for now it's fine
Im having some trouble with my cinemachine:
- The camera snaps in a weird way when the player is falling
- The camera doesnt line up in the center when restarting the game by dieing
This is my virtual camera component:
I also have a video where i show these problems: https://streamable.com/ty43uh
Anyone know a solution?
the weird snapping just looks like you don't have interpolation enabled for the player's Rigidbody
should it be set to interpolate
yes
Hey I have a problem with camera, after trying to set far clip plane greater than 2^15 half of the screen becomes blurred, did anyone encounter this problem?
Does anyone have any idea how I can mimic a blend between two virtual cameras similar to how this looks?
My first thought would be to somehow edit the rotation curves of the blend in order to preserve the original camera's rotation for longer, but the only curve is for overall blend speed, not position and rotation blend speed individually
Unless I'm missing something and I can do that somehow?
It might need more than two cameras. The zoom initially you could do by animating the focal length, otherwise that would be two cameras (blending to get closer), then there is a rotation (feels like a third camera), then a final flip down to horizontal (a fourth camera).
This looks like a job for a Dolly Track to me
Hey! Not sure whether this would really go here or a code channel (or even input system channel?), but I just started with Cinemachine yesterday
What I'm trying to do is move the camera (I'm using Free Look) on mouse drag
I found two posts, one however has the solution for phones and the other is for orbit (I want the camera to move depending on where the mouse drags)
I've already achieved this with built-in Camera, but I had to switch to Cinemachine due to collisions
Any tips?
Thank you @bronze moon, I'm not sure where to start, I installed the cinemachine package on my project and inserted a 2D Camera into my camera, it made the whole screen black. not really sure what to do
start with the linked tutorials pinned in this channel
what does "inserted a 2D camera in my camera" mean
is there a way i can have a mask for the camera shake to be stronger at the screen edges and almost non existent towards the middle?
How would that actually work 🤔
Maybe you want some kind of fisheye lens effect, or other postprocessing?
the image would need to be distorted for the edges to move more than the center
I did use lens distortion in HDRP post processing first but the affected part is the middle which is the opposite of what i want. one more thing that made me think about using cinemachine is that i can use events to trigger the effect (for ex. when shooting in fps games)
This effect i see a lot in fps games and it's more of a shake than a distortion but the middle is always clear so that it's not distracting to the player
so i was wondering if i can achieve something like that
Do you have a video example?
i hope it's still visible with the compression
@earnest anvil Look into Cinemachine Impulse signals
make custom signal shape if you must
The secret sauce here is probably the subtle rotational shake
Camera rotation is percieved as greated motion near the edges than along the axis of rotation
Yeah I think this is full camera motion, it's just a rotation around the center of view
so the actual point you're pointing at doesn't change
that's interesting. it makes a lot more sense that way
I have to code this behavior right?
@errant shard @royal tartan
Not necessarily
Cinemachine allows you to define entirely custom shake noise to blend to
is it this like Null suggested?
because it doesn't seem to be changing the camera transform
I'm not very familiar with impulses
I believe they're mainly intended for making propagating shockwaves (from explosions for example), but I don't know how handy they are for knocking around singular cameras
Will probably work if you can define the impulse to add rotational motion with some randomness, I expect
I think i found it. I never knew about this but apparently you can create a noise preset asset for cinemachine and define the position and rotation curves 😊
Thank you everyone
Im using pixel perfect camera for the 2d pixel game im working on but when I turn on upscale render texture and move in game it becomes blurry and kinda like jitters around. Is there any way to fix this? (pixel per unit is 16 as well as all other sprites) (I think it has to do with my camera/cinemachine because when I make the camera not follow and at a fixed position the issue stops happening) and yes I have the pixel perfect addon thing for the cinemachine, for a better description of what happens, when my character moves it kinda jitters around whilst still moving normally but it jitters forward and backwards making this blurry effect and making some gray pixels on the edge as it jitters really fast
I can send a video of what happens if anyone wants!
With pixel perfect rendering you should use exactly zero damping on your cameras
If the moving camera and objects it follows it are not perfectly in sync, they jitter visually
All kinds of smooth motion can be problematic
Thank you so much!
hm it works for the most part so it works when moving left or right but when falling or jumping it seems to still have the same issue, I've set all axis of damping to zero do you know solutions for this??
How can I have a camera rotate with another body like a car and then apply the pov after, that way if you dont move the mouse it rotates with the vehicle and if you move the mouse it adds to the current rotation?
If you make the camera a child of the car, it will move and rotate with the car (it’s parent). You can still update the local rotation of the camera with the mouse so it will rotate relative to the car
Hmm. Have you tried the Body mode of "Hard Lock to Target"? There are quite a few settings to control "dutch" etc of camera - maybe you can use some of the Bias properties etc to add roll etc. to the camera. With Hard Lock to Target, you don't have to make it a child - just a separate game object that specifies the car as the follow target (and maybe aim target). It can then "follow" the car, and use the "aim" properties to tilt the camera instead.
This game uses Dolly track type camera right?
If the camera doesn't move in a straight line, and moves the same way in reverse, then you can probably assume it does. I don't know the game though.
is anyone having issues with FreeLook being jerky on the Y axis? Using the new input system and CinemachineInputProvider
How can I remove this sort of shoot to the center when stopping with movement
I just want it to be smooth to the center as the beginning
I think the damping must be higher to have it smoother.
then I almost run out of screen
What do you mean by that?
the damping makes it so that I can go further away from the center of the camera view
Like this
@long creek mine is setup like this and it's smooth when recentering
waduheck
Your Follow & LookAt are the same?
yes
I have a feeling CM is a bit broken in places
I'm running on fixed update if it matters
Unfortunately not
Hey! I'm using dolly track to follow player movement. I want it to keep camera at a certain distance from player at all times. How can I achieve that?
Cinemachine virtual cameras have a follow capability. There is aim (what to print camera at) and body (follow) where you can specify offsets. You don’t need a dolly and cart for that.
how do we get correct mouse movement with freelook and the new input system? it does't seem to work correctly using the CinemachineInputProvider
I'm trying to achieve cinematic camera movement while gameplay which is possible with dolly track. Just, I want the camera to keep a certain distance from player, even if the track is closer to player.
why not move the track?
But I want the track path to be that way.
A cart and dolly can move something along the track. There is no support that I know of to make it follow a cart track but not get closer than a certain distance. You would have to write a script for something like that
moving this here from #archived-code-general : hi yall, I'm working on getting a death sequence to reset the camera properly with Cinemachine, and I'm running into an issue where the camera slowly pans over the world, some of which has been unloaded, to reach the player. I'm trying to use OnTargetObjectWarped, but I think because the camera is part of a State-Based Camera, the transition isn't complete when I call it and so it doesn't behave properly. Is there a way to override blend settigs to change the active camera of a state-based camera?
camAnimator.GetComponent<Animator>().Play("MouseCam");
Vector3 deltaPos = respawnPosition.position - transform.position;
transform.position = respawnPosition.position;
followCam.OnTargetObjectWarped(transform, deltaPos);
this is what I'm working with right now, but the camera doesn't warp immediately when the player respawns because of the blending
can somone help me with using post processing with cinemachine. im having trouble even though ive done everything that videos have told me to do
cinemachine isn't really relevant to postprocessing AFAIK
it just positions/rotates your cameras
Which render pipeline are you using? It is different for different pipelines, so you need to be careful you are watching a video compatible with the pipeline you are using
Eg with hdrp you can do things like focal blur and blend between them with virtual cameras
I expect a cinemachine component is necessary to let vcams define their interactions with post processing volumes the way cameras normally do, to allow blending
got this weird camera jitter when moving fast on the Y axis using a "Follow", what could be causing this?
here are the cinemachine settings
Do you have interpolation enabled on your player's Rigidbody2D?
How can I edit what noise is selected with c# or do I have to change the entire camera
(in CinemachineVirtualCamera Settings)
Rigidbody interpolation should be enabled as mentioned, and additionally all vcam damping should be 0
To add to this from Praetor's link , serialize a couple of NoiseSettings profile noises (the ones from Cinemachine are in Packages>Cinemachine>Noise )
example ```cs
[SerializeField]
CinemachineVirtualCamera virtualCamera;
CinemachineBasicMultiChannelPerlin noisePerlin;
[SerializeField]
NoiseSettings Profile1, Profile2;
private void Start()
{
noisePerlin= virtualCamera.GetCinemachineComponent<CinemachineBasicMultiChannelPerlin>();
noisePerlin.m_NoiseProfile = Profile1; //etc
}```
Thank you so much!
I did have those set like that, not sure what else I could have messed up for it to get jittery like that
You might need the pixel perfect vcam extension in addition / instead of the pixel perfect component
I'd double check what the procedure is with that
I can't think of any built-in way to make them share properties
I recall in forum threads the devs mentioned having to alter each rig of a freelook camera, which suggests there's not even a way to group properties like that even within the same cinemachinecomponent, let alone between separate vcam components
But I expect you could create such a system yourself without much hassle
That could be practical
All it really needs to be is a script that holds references to variables and sets them according to some rule
As a side note they're called virtual cameras or vcams, "cinemachine" refers to other parts of the system
Not as far as I can tell
when I select that option nothing happens
no components get added or changed on the camera or the brain
when I add other ones, it works fine
oh, it seems I already had that component added beforehand, but it was collapsed and near the top, so it seems to not have worked as the issue is still the same
however, when I disable the pixel perfect camera on the brain, the issue disappears, but the pixels no longer snap
as this does not seem to have an option for it
Is there a Cinemachine-y way to specify a virtual camera to be perspective/orthographic? The only way I can think of is to have a script on the object that checks if the virtual camera is active and change the perspective mode of the actual camera accordingly but that seems like a janky hack for something that Cinemachine probably does natively somewhere
I see stuff online about having transitions between them needing custom code, but I don't need that, just a direct cut-to would be fine
LensSettings has an Orthographic property
Ah, hidden in a second dropdown. Sneaky bastard
He guys would anyone know to to achieve this type of camera with cinemachine?https://www.youtube.com/watch?v=kmOD9ia2n24&t=89s&ab_channel=IGN
Check out some tracks from the Wipeout Omega Collection running in 4K 60fps.
Watch Everything from PSX 2016 here!
https://www.youtube.com/watch?v=BVolJ3L15lM&list=PLraFbwCoisJDGNMvYoK8UTa1LlMgUhY0U&index=2
Check out our PlayStation 4 Pro Review:
https://www.youtube.com/watch?v=jfVCn8qJ690
While you're at it, catch our PlayStation VR Review her...
I think so. You can blend smoothly between views, it can follow an object with damping, there is an orbiter algorithm https://docs.unity3d.com/Packages/com.unity.cinemachine@2.8/manual/CinemachineBodyOrbitalTransposer.html. But I have never tried it in a real game
Thx will take a look
Hello so a simple question about cinemachine. I have multiple cameras on a scene, when im trying to hone in the position and whatnot of one of the cameras i have no feed to see the changes in the game window, how do i go about getting that?
Sorry might have asked for help a little premature, I guess i can just temporarly disable other cameras and get the feed.
In the inspector every cinemachine virtual camera has a "Solo" button
this lets you preview the position in the game camera
ayo, I have a question
so how can I lock the camera when the player falls of the bounds in 2D
like when the player falls into the void, the camera doesn't follow the player but locks itself
I can think of three ways
- Use a vcam target that gets its position from the player's, but has its height position clamped to a cutoff value
- Use https://docs.unity3d.com/Packages/com.unity.cinemachine@2.9/manual/CinemachineConfiner2D.html, usually the most elegant solution but may be impractical for really big worlds, and maybe overkill for just one axis clamping
- Use
transposer.ForceCameraPositionto clamp the vcam position directly, though overwriting vcam transforms in code can be finicky and conflict with its own motion
how do I do the first way, I'm not very advanced
If it seems too complex to make a script that copies and modifies a position, I recommend setting up the Confiner instead
What is a Confiner tho (sorry about the questions but it's actually my first project where I try to make something better)
I linked you the documentation for it
You can't really use Unity without doing beginner tutorials or a course for it
I mean I'm doing a youtube course for a 2D platformer, also I started using unity like 2 years ago but I didn't get any far until now
Furthermore I would require anyone using Cinemachine to read the first few articles of its documentation
C# scripting is really important skill to know at least the basics of, since Unity doesn't really do much anything without it
Modifying transform component values is one of the most basic forms of that
I'm using a 2D follow camera with a pixel perfect component on the main cam and the pixel perfect extension on the virtual cam. There is noticeable jittering when moving vertically
Hello Guys.
I'm trying to set up a third person camera using cinemachine and its working well, but whenever i move behind something, my player disapears from the camera. and i dont really want that
any help i could get?
How are you moving your character?
What update mode does your cinemachine brain use?
Rigidbody2D. Velocity is manipulated in FixedUpdate, including gravity
Update method: Smart Update
Blend update method: Late Update
Make sure rigidbody has interpolation enabled
Make sure vcams have no damping of any kind
Both are done
smart update should be smart enough to handle it but see what happens when you make it Late Update
and to be clear you're moving only via Rigidbody2D velocity?
Yeah
Well, there is a RigidBody2D.MovePosition in the ground detection logic, but that doesn't while jumping
Can you share your code?
I'd rather see the whole file
in a paste site
Don't worry I'm used to reading lots of code.
using System;
using UnityEngine;
using UnityEngine.InputSystem;
public class AvatarGroundedState : AvatarStateComponent
{
[Header("State")]
public bool canStartAttack = true;
[Header("Refs")]
public float groundCheckDistance = 0.01f;
public GameObject midAirState;
public GameObject jumpState;
public GameObject slash1State;
public GameObject dashState;
void OnJumpPressed(InputAction.CallbackContext obj)
{
ctrl.sm.SwitchTo(jumpState);
}
private void OnFirePressed(InputAction.CallbackContext obj)
{
if (canStartAttack) ctrl.sm.SwitchTo(slash1State);
}
private void OnDashPressed(InputAction.CallbackContext obj)
{
ctrl.sm.SwitchTo(dashState);
}
private void OnCollExit(Collision2D collision)
{
if (!ctrl.collision.TouchingGround())
{
RaycastHit2D hit = Physics2D.BoxCast(ctrl.collider.bounds.center, ctrl.collider.size, 0, -transform.up, 0.5f);
if (hit.collider != null && ctrl.collision.IsGroundNormal(hit.normal))
{
ctrl.rb.MovePosition(hit.centroid - ctrl.collider.offset);
Vector2 velocity = ctrl.rb.velocity;
velocity.y = 0f;
ctrl.rb.velocity = velocity;
}
else
{
ctrl.sm.SwitchTo(midAirState);
}
}
}
void OnEnable()
{
ctrl.input.jump.performed += OnJumpPressed;
ctrl.input.dash.performed += OnDashPressed;
ctrl.input.fire.performed += OnFirePressed;
ctrl.collision.exit += OnCollExit;
}
void OnDisable()
{
ctrl.input.jump.performed -= OnJumpPressed;
ctrl.input.dash.performed -= OnDashPressed;
ctrl.input.fire.performed -= OnFirePressed;
ctrl.collision.exit -= OnCollExit;
}
}
ok yeah this is weird ctrl.rb.MovePosition(hit.centroid - ctrl.collider.offset);
what is this for again?
When in the grounded state and you exit the collision, it makes a boxcast below you to check for terrain
If it finds any, it moves you down to the centroid of that boxcast and keeps you grounded
Otherwise, you go into mid-air state
Commenting out that part of the code doesn't change the vertical jittering (as it shouldn't)
The gameobject this script is on isn't even active when you're in the air
Can Cinemachine be used to get stills of scenes?
can someone explain what is a local frame of a target ?
"Make the Virtual Camera use the Follow target’s local frame at the moment that the Virtual Camera is activated or when the target is assigned. This offset remains constant in world space. Also, the camera does not rotate along with the target."
this is for transposer
Well, kind of. If you are talking about capturing a still from a cutscene that you animated in a Timeline with Cinemachine virtual cameras panning the camera around - then there is a "Recorder" track you can add to a timeline to capture stills or movies etc. But if you are talking about playing a game and capturing the current screen - no Cinemachine is not designed for that. (There is a live capture mode for recorder...) But its more camera movement controls with other things. So while you can capture a screen, Cinemachine is probably overkill. (But don't ask me how to do it! I don't create games, just movies/cutscenes!)
Don't you love phrases that are not defined? I assume its referring to the local position and rotation of the target object. Damping settings are relative to the local space of the target object (maybe if scale is used this makes a difference???). So "Lock to Target" behaves the same as making it a child of the target. The example given is imagine gluing a camera to a door. If you open the door, the camera moves with the door. In my mind though i just cross those words out as I read the docs! Lol!
Ok, that would make sense, but why wouldn't they say local transform? My assumption was that it is referring to screen space position
but yeah, Unity docs are such garbage 80% of the time
can anyone help me smooth out my cinemachine first person camera it seems its a bit too sensitive
reduce your mouse sensitivity
also its snappy
Hey does anyone know how to make it so that my orbiting camera (mouse delta driven) only works when the mouse button is held down?
using the new input system
Guys how with cinemachine i can make the camera look where my car is going like how to make the cam look to the velocity vector ?
if (myAction.IsPressed()) {
// mouse look code
}```
How to I set the initial position of a virtual camera? I have it set to follow a character, but when game starts, it always comes from origin to the right position, and it resets to origin after game is closed.
that means the first few frames are with the camera moving very fast from origin to the intended position
the behavior you're describing is not normal for Cinemachine and probably results from either:
- A different vCam being selected initially and Cinemachine transitioning between cameras
- Your follow target is starting at the origin and teleporting into position
It's possibly the first option. I have two vcams in the scene, one with priority 10 and another with higher priority
it should start with the one with higher priority
does it select the other initially because of hierarchy, maybe?
ohh, actually, the second camera (higher priority) follows the first, but offset
I think it will always start with the higher priority, regardless of hierarchy
but you could always try disabling the other one temporarily
Ok, I suppose the problem has to do with the double camera setting.
- Camera A (free look) follows the player.
- Camera B (3rd person) follows Camera A.
- Both look at the player.
In short, Camera B is an offset of Camera A, to allow this effect:
Camera A = exploration camera, Camera B = menu camera.
this looks great btw
so am I seeing the problem in this video, or this is an illustration of how it's supposed to work
it only jitters in the first few frames of the game, when it starts
it doesn't have a problem after
it's not in the video
I feel like having one camera follow another is a bit weird/unsupported.
What happens is probably a racing problem. Camera B follows Camera A, which follows the player. It is updating Camera A at the beginning, but Camera B only follows one frame after
One thing to try is set the update mode of both cameras to "Always"
then it's the time to blend from one camera to the other
yeah could be something like this
camera B sees as if Camera A starts at origin
a better option would be to have both cameras follow the player
and/or use a proxy object that follows the player via a PositionConstraint or ParentConstraint and have camera B follow that
it's because the Camera A is free move, so it can rotate around the player
I suppose I can start following the player, since it should start at zero angle anyway
Has anyone here made an extension for cinemachine ?
I am trying to use default camera offset extension and add multiple offset values
so instead of Vector3 m_Offset I would like that to be a list
any suggestions on how to do that ?
i want to resize my camera in a certain way but it only scales the x and y proportionally, how can i disable the proportions?
the aspect ratio is based on the aspect ratio of your game window
Hey thanks. I don't suppose I can get more explanation about this? I'm not sure where I would place this script or what script I would be adjusting to include this. For now I'm only using Input Actions which are referenced by the CM camera
Oh it's ok I added a modifier and this seemed to do the trick
how can i make the camera smoother ?
I have a free look camera that follows my third person character, but im struggling to get mouse controls right. I can't look behind me because the mouse always leaves the game window so I cant turn enough. Does anyone have any suggestions on how to resolve this?
A different approach I have taken at times is to create another empty game object and add a script to move it around (e.g. track a mid point between several other objects). Add a child cube during debugging to see its movement. Then you can use a standard virtual camera and follow that gameobject etc. It just keeps your code separate from virtual machine code, which I always worry about APIs changing, getting updated etc.
Can you supply more information about what you are doing? Follow? Aim? Following what? etc. Hard to make a suggestion without more information.
Smoother than what
okay sorry
so my camera is following my car in my game but when the car turns a lot or drift the camera's movement is not very smooth so i wondered if i could make it smoother with cinemachine
Cinemachine virtual cameras have tracking "dampening" support - you can specify a target and it tries to keep it centered. That might help smooth things out - but you would have to try it. Its the "look at" (aim) and follow settings.
Okay okay so i have like to up the dampening or decrease it ?
I would just adjust the numbers and see what looks good for your case. It may be a combination of values. I am really just saying it may be worth the investment of time to experiment - there are controls there for smoothing out movement. I don't know if good enough for what you need.
Like you mean there are other controls that can smooth the movement ?
Because the problem is that in my car game, when i go backwards the camera look at the front of the car(so you can look where the car is going in reverse)
But the camera movement is very fast and i would like to slow it
Does anyone know if it's possible to do a DoTween style Fov change on a Cinemachine Freelook camera
Can anyone see why my function ZoomOut wouldn't work when all the other functions are working fine?
It seems that (line 91) https://paste.ofcode.org/QyxBnKuHk4LNZNfsBUgk6u does confirm that value is changed however my scene's freelook camera isn't updating. Could it be that I'm changing the wrong camera? This doesn't make sense since the other functions are changing the same values and they ARE updating on the scene camera
yep just transition from a zoomed camera to a non zoomed camera
OR literally use DOTween to animate the FOV
DOTween can tween literally any value you want.
I got this working by moving the lines of the ZoomOut function to the LateUpdate function listening to a bool variable to trigger it. No idea why this works
@royal tartan Can I ask, now that I have a smooth orbiting solution working and want a button on the UI to reset the orbit to a specific position, is it correct that I can set the orbit and X/Y axis params directly in the script to move the freelook cam to the desired position?
Bc when I do this it doesn't move to where I expect
Work with Cinemachine, don't try to fight against it
make another virtual camera. Put your camera script on that
use that camera when you want to control it manually
switch to the other one when you want to do whatever else you want to do (like shake)
I'll probably try the transition because using the DoFov function produces the error : CinemachineFreeLook doesn't have the component camera (I'm not at my pc right now so that might not be accurate)
Not DOFOV
You'd have to use DOTWeen.To
Oh okay, I'll try when I get home
How would I put in proper args to change the fov? I looked at the documentation but I don't think I understand the usage properly
You pass it a setter function and the initial and target values. There's examples in the docs
I think it did work but I opted for the cinemachine blend instead
i have a freelook camera, all of the values are correct, the follow and look at is the player's gameobject, but the main camera's position is at 0,0,0 for some reason
any ideas why this happens?
^it seems like clicking solo fixes it, but it only works once since i have to click it everytime i playtest..
Sounds like multiple virtual cameras fighting over the main camera
i’ll check if that’s the issue
^the issue was that i accidentally selected my player and pressed the add freelook button, and it made a couple of "...Rig" objects, deleting those fixed it
Is there a way to have a virtual camera have a culling mask, like a normal camera has? I hear that this isn't possible by default, but that there may be an extension for it..?
The google search I just did was people saying "you cannot use cinemachine virtual cameras to change the culling mask of the main camera" (and probably never will). So you would have to write a custom extension if you needed to have virtual cameras change the mask. (You can still set it on the main camera - just not change it as part of the virtual camera settings.)
So the first question is whether just changing it on the main camera is good enough. Otherwise you probably have to write it yourself. (I cannot see anyone who has done one)
Hmm, I see. Thanks!
i suddenly got this bug where my rotate code no longer works? happened after I dragged sprite onto camera look in cinemachine transform.Rotate(0, 180, 180);
its changing the X instead of the Y and Z values, is there a solution im stumped
Euler angles are not unique
(180, 0, 0) is probably equivalent to (0, 180, 180)
euler angles are funny like that
actually yeah you can do it with your hand
and see easily that those rotations are equivalent
ok so sprite will not show in game when its rotated 180
its going behind this invisible thing?
It's probably going behind the camera
it was! thx
how do I fix this blurring?
Set the game view scale back to 1
wow ty
sup, wanna have multiple static cameras around the scene, then when the player (FPS camera) enters in range, the camera switches to the static camera
better to use Clear Shot or State Driven?
if you want to know context, its for static interactable items. such as a mouse input keyboard and book
Cinemachine's importable samples has a scenes showing various implementations of this
kk, i'll check it out. how do i access the samples?
do they come bundled with the plugin?
Find Cinemachine in the package manager, there should be a section for samples in the description
(many packages have them and they are great)
how do i get the value in pov on script
does cinemachine have any function that will let me blur the whole game except the UI? or how else can i do this?
how do i make a new forward depending where im looking at
This is more of a #💥┃post-processing concern
character.transform.forward
can i dm u
No
...
where do i put that
In your code?
ye
Idk you shared essentially 0 information so how am I supposed to answer you
You asked how to get the forwrad direciton
that's how to get it
you put that wherever you need it.
ill just send u my script
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.
thats my camera script
https://pastebin.com/sbB6PX2M this is my movement script
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.
where it says gameobject.find and the stuff below that u can ignore it was just me messing about
I have two cameras with the only difference being different culling masks, yet one has a different "current pixel ratio" when I add a pixel perfect camera with the same settings as well to both of them
why does changing the culling change the pixel ratio?
Hi! How can I implement a walk animation? Make the camera move when you are walking/running? Is that an animation, a cinemachine effect..?
If I understand correctly, either an animation or some sinusoidal movement via code should be fine, as cinemachine doesn't have head a head bobbing effect by default
@half shuttle I'm trying to do it with a noise profile, but can't access it from a script 😦
have you accessed it in a way like this?
CinemachineVirtualCamera vcam;
vcam.GetCinemachineComponent<CinemachineBasicMultiChannelPerlin>()
with then a dot and name of the thing you are modifying
Yeah hahah got it working literally right now
Didn't know about that GetCinemachineComponent method
Was looking in the script properties
Thanks n.n
ye, it is a bit confusing
The cinemachine script reference seems to do a dismal job of showing the methods you're actually meant to use
Cinemachine Virtual Cameras have the ability to aim towards a target (look at them) and follow a target (at a specified offset). These are not animation effects. You can make it follow the root of the character for a stable camera movement, or follow part of the head if you want it to bob around. You can use damping to adjust how closely it matches the target object.
You can also create dolly tracks for example (spline curves) and make the camera move that way too.
I did ask about this issue a week or so ago, but will ask again just in case:
I have a pixel perfect cinemachine camera following the player, the player's rigidbody is set to "interpolate" and there is no damping on the camera, so wanted to ask what else should I change/add to remove this kind of jitter when moving vertically (as horizontally it seems to be totally fine)
what is your cinemachine brain update mode set to
smart update
try LateUpdate see what happens
(smart update should be able to pick the right one though)
sadly still same jitter
And if you disable pixel perfect?
the jitter is removed, but then the image is no longer pixel perfect
maybe I'm messing up with the render textures?
as basically, the pixel perfect cam is put on a render texture, which then is shown to the main camera
ok so it's probably slight perturbations being exacerbated by pixel perfect shifting
what your cinemachine vcam settings
wha happens if you either:
- use unlimited soft zone
- set soft zone and dead zone to same size
sadly no changes in both cases
maybe I'll just, zoom the camera out far enough for the player to not notice lol
does the cinemachine confine use the center of the camera for the polygon?
it uses the camera's position, and some bounding volume(s) you define
okay thanks
for the state driven camera, is it possible to use something other than the animator as the state machine?
now with a pixel perfect camera I have an issue that what is shown in the viewport is not what gets rendered on the render texture
the viewport preview thing probably uses your game view window resolution, but the RenderTexture has its own fixed resolution
how could I make the render texture match what the viewport sees then?
easier to go the other way around
so make the viewport match the render texture?
as right now, I try to have the game render a 426x240 screen to a render texture
and no matter what I set the size of the render texture, it never matches the viewport
this is the reference resolution of your PP camera, not the render texture resolution
I know, it's just that no matter what I set the render tex resolution, it is always smaller than the pp camera resolution
I def must be messing up some basic thing, as I don't have much experience with pixel perfect stuff
the camera resolution is the game resolution
game resolution is what you should be setting to match
oh, ye, now it works, thank you!
also had some weird issue where the viewport rect of some cameras was randomly way different from default, so some extra issues were solved while doing this lol
though wait, it's still not matching the viewport even after the changes, though it is quite a bit closer now
the size of the render texture is the same as the game resolution
and the pixel perfect cam has a resolution of half of that
I genuinely do not know what could be causing the error at this point
wow this channel has been dead for a while 😛
is there a way to have a cinemachine extension to ignore an inputted position whilst having access to the what was to be the new camera position in code for that update cycle?
i solved it by not using a custom cinemachine extension
This has been bothering me forever but.
A lot of the time, when I'm trying to position a camera in non-gameplay mode. It doesn't update in the GameView, unless I change the Priority to like -1000 back to something high like 1000.
Anyone have any ideas?
So I have damping on cinemachine off and have interpolation off (for pixel perfect) and it works great theres no jittering on the player and stuff like that, but if I turn interpolation off the camera follow is very non smooth and feels like its moving by noticable chunks rather than a smooth follow and I only have Upscale render texture rather than pixel snapping, so does any one know the fix to this issue? or is it always supposed to be like this?
It mainly feels like low fps
Which interpolation do you mean?
If you mean rigidbody interpolation, that has nothing to do with pixel perfectness and should be kept on
It just makes the rigidbody gameobject update its position each frame, rather than each physics timestep which is usually considerably less frequent
Hey, I'm trying to add camera shake to my game. I have two different cinemachine cameras but I'm trying to assign the camera shake to the camera to the one with the highest priority. (currentCam variable). How do change the local position of a cinemachine camera that will move the main camera?
probably just attact a monobehavior to the cinemachine brain and get the highest priority cam from the cinemachine brain
Trying to use Cinemachine to follow a target with the framing transposer in 3d but am running into errors. First I ran into an error where the Y position was changing when moving the characater in the "forward" or "backwards" movements as shown here in this video
https://streamable.com/gn2hxl
But I fixed this by using the following "LockCameraY" script that I found online.
using UnityEngine;
using Cinemachine;
/// <summary>
/// An add-on module for Cinemachine Virtual Camera that locks the camera's Z co-ordinate
/// </summary>
[ExecuteInEditMode]
[SaveDuringPlay]
[AddComponentMenu("")] // Hide in menu
public class LockCameraY : CinemachineExtension
{
[Tooltip("Lock the camera's Y position to this value")]
public float m_YPosition = 10;
protected override void PostPipelineStageCallback(
CinemachineVirtualCameraBase vcam,
CinemachineCore.Stage stage, ref CameraState state, float deltaTime)
{
if (stage == CinemachineCore.Stage.Finalize)
{
var pos = state.RawPosition;
pos.y = m_YPosition;
state.RawPosition = pos;
}
}
}
however I am still facing yes another issue where even though that is now fixed, the camera still moves and tracks the target along its Z position even though the target is not in the dead zones. video to follow momentarily
Looking to fix this
I feel like this may be fixable by locking the cameras Z position until the target is in the dead zone, HOWEVER, I am unsure of how to check when the target is actually in the dead zone
or if thats even the best solution
Which I may have figured out how to determine if the target is in the dead zone or not.
if you take the screen height and multiply that by the dead zone height value, then subtract that number from the screen height and divide that number by 2, that should give you the threshold from the top and bottom. if the target is in that threshold they're in the dead zone. then you can enable and disable the script for locking the z position from there... thats the idea anyways, time to see if it works 🤞
Okay so I turned on the interpolation on the rigid body and the updating/fps issue is fixed but when moving verically it jitters up and down so is there something else I have to do as I have no damping and is there another interpolating connected to the cinemachine I do not know about?
and it didn't really work.. 😦
nvm I fixed it ty
For me to fix it I had to have interpolate on and no damping and make sure you have lens ortho size on your cinemachine to 0 or it will interfere with the pixel perfect I believe as the pixel perfect camera size is what matters
Is there some way to override/define the timeframe cinemachine uses? I'm using a fixed time step in a network game and I think cinemachine's LateUpdate is happening during the interpolation phase so it causes some visual jitter.
Any ideas?
anyone able to help with this please?
I was looking at it, but I don't have an explanation! If you can repeat in a small project, I would be tempted to upload to Unity as a potential bug. (I assume the problem is the "Y" movement goes into the dead zone at the bottom in your video, which should never happen, but does not reach it at the top. Its like some offset is out.)
I'm not sure what you mean by your interpretation of my problem, I don't know if I'm understanding you correctly. Just to clarify, the issue I'm seeing here is that after locking the Z movement (issue shown in first video) the Y value still changes even though the targeted game object is not in the dead zone (shown in the later half of the second video when I make it go "forwards" and "backwards" - not horizontal)
I'll upload the whole project either some time later tonight or sometime tomorrow to a dropbox or something and then DM you the link if you're okay with that. If you want to submit it as a bug or take a look to see if you can solve it then I'll be happy. If you take some time to figure out the issue and fix that I'll be happy to pay you some sort of tip or something as compensation for your time.
I am just a user like you - but have created a few bugs and uploaded them to Unity (its in the Unity menus) and they have fixed them when there is a repeatable test case. But to be clear, I was noticing the dot going into the dead zone at the bottom and would never reach it at the top. I cannot see the actual numbers for X/Y/Z (too fuzzy in video and my eyes! ;-))
And actually I had it backwards - in the second video its the z movement that still changing not the y value
oh gotcha, yeah I hadn't really noticed but you're right
is that from the first or second video?
The first
interesting
thats just the framing composer with standard settings really.
no z or y locking
Yes. I don't have an answer for the problem, but the different offset at the top and bottom in the second video was also a problem even in the first video (just amplified)
How can I make the cinemachine camera actually preserve distance? Whenever it hits an object it just flashes in, which tends to not look very good at all
I would have thought preserver camera distance would move the camera upwards if it cant see the player
Sorry, I don't understand the question. Could you expand perhaps? Cinemachine can keep the camera at a distance, but I don't know of any logic in there to say "if you cannot see the target, move the camera around so you can see it". I don't think it is that advanced.
greetings. i have a problem where i need to set the ease time to 0 for a frame, or change it to cut. i want it to be ease in for 0.5 sec when going between rooms in my 2d platformer, but i want it to cut when teleporting between rooms. how i do that?
both the m_DefaultBlend.BlendCurve and .BlendTime are getters only so i can't set it like that.
Edit for anyone searching for this in the future: Use a custom blend (any camera to any camera) ([SerializeField] CinemachineBlenderSettings variableName) then set the time
(variableName.m_CustomBlends[0].m_Blend.m_Time = 0f) for .1f or so.
hey everyone im having a problem animating the camera when i hit this buttoncan anyone help?
here is the code
Why exactly happen when I failed to add member into CinemachineTargetGroup?
I just spawned a GameObject and then adding that into the target group immediately after instantiate.
How to solve this issue?
Nevermind, found a bug which called AddMember and the RemoveMember
#💻┃code-beginner message
this is the channel i was supposed to post it in
Is there any way to apply the noise of a cinemachine virtual camera to other transforms?
not sure about Noise but you can use Impulse signals with other objects
https://docs.unity3d.com/Packages/com.unity.cinemachine@2.9/manual/CinemachineImpulseSourceOverview.html
I will look into it thanks!
You can always just throw a virtual camera component on whatever transform you want and have it set to always update
And just set the priority super low so it never becomes the live camera
is there a way to programmatically get a framing transposer camera to center itself on the follow target other than just programmatically setting the deadzones to 0?
That sounds convenient, thanks!
Hey! I have a gameObject called CameraAnchorPoint and I have a Virtual cinemachine set to framing transposer that is is following the player..
I would like to move the Virtual camera to the GameObject's location and back again
any help would be amazing
With Timeline (my area of expertise), you would normally have two virtual cameras and blend between them using CinemachineBrain on the main camera to do the magic. This thread talks about options a bit https://forum.unity.com/threads/cinemachine-virtual-camera-switch-target-at-runtime-in-virtual-camera-its-causing-jerk.498498/
Hi, @Adam_Myhill, I am using cinemachine virtual camera for my racing game. And I am using multiple virtual cameras, to show different views in racing....
don't cineamchine cameras already blend by just setting a different one as the active camera?
blend property in cinemachine brain
no need to use timeline
Hi, im playing with the third person template. For two type of gameplay i need different management of camera, and i got working one of this, but cant manage to achieve this:
Camera should follow PlayerArmature Z position only (down to top screen) without change camera rotation or move left/right. Body transposer and bind world space is newr to the result but still follow the X axis nad rotate like 30deg during movement on left or right.. any tips?
There may be a better way, but assuming you are using Cinemachine virtual cameras, I personally have avoided trying to mess with their logic, and instead create a new empty game object with a script to track what I want to look at. Then I point a standard virtual camera at that game object. While testing, you can drop a sphere or similar under the empty game object so you can see it.
That is, write a script to move the empty game object based on your specific logic, if virtual cameras don't support it natively.
Correct - I was just saying I have only done it in Timeline. I am not a game developer, so I agree it should work, I have just never tried it.
Hey could any1 help me understand why i cant move my camera around?
I think i set everything up right
but i dont know where to start checking
start by checking whatever code you expect to move the camera