#🎥┃cinemachine

1 messages · Page 13 of 1

royal tartan
#

note that cinemachine has nothing to do with rendering. #1390346776804069396 would be the place to ask.

Cinemachine simply positions and rotates your camera.

odd elk
#

Whats the best way to setup a camera that simply follows an object, and zooms in and out with mouse wheel, and middle mouse click drag rotates but still orbits that object. Exactly like OSRS if anybody plays that or mostly any 3rd person game? Any easy and simple way to do so?

ivory wraith
#

If you are still having a problem, it sounds like your shaking is too strong at higher frequencies

#

As you increase your sample rate (i.e., your framerate), you'll start perceiving higher frequency signals more clearly

#

It's hard to say for sure what's wrong without an example though

mystic cloak
#

at higher fps

ivory wraith
#

To help visualize the problem, you could log the camera's position each frame and look at how quickly it's changing

#

or maybe use Debug.DrawLine to plot the path the camera is following

#

e.g. Debug.DrawLine(transform.position, lastFramePos, Color.red, 1f);

#

where lastFramePos is a field that you store your position in, of course

#

It does sound like you just have too much high-frequency shaking, though

mystic cloak
#

i'll try this out next time i work on the camera, cus i dont really haev the project open at the minute. its a bit of a non issue honestly but it feels yucky to me lol

ivory wraith
#

I often test my game at very high and low framerates to see if anything feels "weird"

#

low framerates will expose any "off-by-one-frame" errors

#

like a camera getting moved before its target moves

#

that was causing some really weird uncanny head poses for NPCs

#

i could tell they weren't quite looking at me

#

I hadn't actually considered how high framerates could cause problems like that

#

(beyond the obvious cases)

#

You're experiencing the Nyquist-Shannon sampling theorem here, I think 😉

#

if you aren't sampling quickly enough (i.e. your framerate is too low), you won't experience the full intensity of the shake

#

the camera simply can't go up and down fast enough

#

I don't think you can edit the built-in shake settings, but you can make a copy of one and then try adjusting it

#

(i've only done a little of that)

half shuttle
#

I'd like to switch cameras depending on which cameras can see the player, and if multiple cameras see the player, the one which is closest should be chosen.
I tried doing it with clearshot and trying to adjust the distance variables, but it doesn't seem to really work.
Is there some function in cinemachine I'm missing/misusing, or would behaviour like that need to be coded from scratch?

royal tartan
#

just noticed you said you tried it

#

what went wrong exactly? It should work fine

half shuttle
#

I'll record it and post in a sec

#

But basically, I have two cameras looking in a similar direction, but one of them is quite far away, and a second one is relatively close, and it doesn't seem to want to switch

#

Tested with both the player tag being ignored and with it not being ignored
also tried messing with increasing the priority on that closer camera, but that did not seem to help

#

What I'm trying to use this for, is basically a fixed camera system for "lower priority" areas, where a super exact trigger zone is not needed, so having the cameras be chosen just by "which one is the closest and in view" seems like a good choice for those places

royal tartan
#

Maybe it thinks the closer camera is occluded for some reason?

#

Try setting Occlusion layers to None for a minute or something

#

and/or disabling all deoccluders etc

half shuttle
#

Alright, will give that a shot
and if it won't work, I'll send a vid without the fog so it's clearer

#

just noticed I messed up the video crop on the right, those are the current clearshot settings

royal tartan
# half shuttle

how far is that camera from the player here? You have a near limit of 5

#

if it's clsoer than 5 it won't get boosted

half shuttle
royal tartan
#

oh sorry actually it's the occlusions that need colliders.

Idk this is odd

half shuttle
#

Yea
As like, the camera does change, but that far-off camera seems to have the highest priority in most cases... somehow
here is a vid with how it looks from the start

late basin
odd elk
#

What is the best preferred and easiest for noob way to setup a camera that follows player object with zoom in and out from mouse wheel, and middle mouse click + drag orbits around the player? Simple OSRS style camera or really any top down 3rd person perspective camera? Thanks for any help I really appreciate it!

cinemachine or script?

royal tartan
#

both

odd elk
#

If a script did all the following, zooming, and orbitting, what would I want cinemachine for? Just curious

ivory wraith
#

Cinemachine would figure out how to pose the camera

#

Your script would tell Cinemachine roughly what you want

odd elk
#

Sorry, what would pose mean in this context? I don't necessarily want a smart camera that avoids objects or sees through things. Cine gives greater control over FOV and things like that I believe, but yeah just curious because I mostly want a dumb camera.

ivory wraith
#

The position and rotation of the camera

#

Your scripts would talk to the CinemachineCamera's position/rotation controls

royal tartan
odd elk
#

I don't think I will need any of that but it could be useful in the future so I guess I'll muddle through it now just in case. thanks!

ivory wraith
#

I use Cinemachine for basically everything, even if I'm not planning to do any camera transitions!

half shuttle
harsh nebula
#

is there a way to drive the "time" parameter of a blend with code? i want an interactive blend between two cameras where the blend parameter is controlled by player input

harsh nebula
#

ahh perfect, thank you

feral shadow
#

Does cinemachine effect its target physics in any way ?
I used rigid body add force character control, and it didn't slide like it normally does

drifting wave
#

Could somebody please tell me how to disable the gizmo that seems to belong to the Cinemachine Rotation Composer? It's getting a bit distracting during playtesting.
I've tried disabling all game gizmos, but it stays visible. I've also tried disabling the one specific to the composer with the same result 🤔 If I deactivate the component, the gizmo goes away - but so does the functionality.

drifting wave
#

Found it! It's in the cinemachine main component and can be controlled with the dropdown entries:

late basin
feral shadow
#

oh, strange the character isn't sliding

royal tartan
#

but uh - yeah it's ultimately down to your movement code

royal tartan
#

<@&502884371011731486> ^^ scam

tranquil berry
#

?ban 866948780962873375 bot scam

marble yachtBOT
#

dynoSuccess promanlul was banned.

sonic badge
#

hi

#

i need help i want to make a FPP camera but if i attach it to the head it start bobbing with the animation and does not rotate freely of the body

mental lake
#

for FPP you want to avoid rotating on a pivot, in other words the camera rotates in its own space, not orbiting around at some XZ offset

sonic badge
#

currently the cinemachine camera is physicaly placed inside the player head and the model move in front of the camera durin the runnin or jump animation

sonic badge
mental lake
sonic badge
#

so capsule of the gameobject

#

but will it move with the head like during jusp or when the character lean forward?

mental lake
#

The main idea is, the camera is at some Y offset to the Player GameObject. Not the skeleton's head in particular, which as you can see can be "in front of" the capsule or offset in general X/Z/ rotation etc

#

Often the Player GameObject has its pivot point at the feet, so an FPP camera is placed at (0, 1.5f, 0) or something.

#

It will move together with the GameObject. But not together with the character's head part of armature lol that would be very offputting.

#

@sonic badge usually FPP cameras don't do anything like that, they use FOV to "zoom" or other things.

sonic badge
#

RN its like this

mental lake
#

Having the camera within the Player GameObject can be tricky because it may rotate together with the GameObject.

sonic badge
#

i have to use FOSS as uni guideline for project so its made using the free asset of asset store

mental lake
#

At 6:03 he shows basic FPP camera settings. I think Cinemachine has it fully built in - no code even needed 🤔

sonic badge
#

ok will watch it but my prof want a implementation of the synopsis tomorrow and it 12:12AM here i dont know weather he will like it or not

sonic badge
#

if i send you a vid can you see and tell if it will suffice?

mental lake
#

FPP is really simple ... Just use the Cinemachine built in stuff like in the other video Unity

sonic badge
#

ok

#

ill try

#

thankyou and goodnight

haughty trellis
#

I'm new to using Unity/using dollys. I'd like the 2nd knot to arch the opposite direction. I'm not super picky about how things flow but I really don't like it getting closer and then backing off. Is this possible with a spline? Do I have to use a different approach? If yes, can you recommend the approach I should use. Here is what I have currently :

#

Here is roughly what I'm looking for :

restive crane
#

I believe I have a good understanding of why the jaggedness is happening but I wanted to check here with anyone that has experience with this issue. I am not sure if I'm on the right track with adding a slerp to ease the rotation.

#

Or possibly just seperate the camera and the movement entirely but I want to have the player's "Forward" position always align with the camera, is this a matter of the script or simply adjusting the rigidbody's attributes? I am going to be experimenting here in a few but wanted to ask just in case...

restive crane
#

Yes

royal tartan
#

I feel like adding any layer of smoothing or interpolation gets in the way of the 1:1 feeling of controlling rotation with a mouse, no?

#

It also frequently leads to issues

#

If you're having "jagginess", it's usually an issue with how you configured things or your code

restive crane
#

view direction and input directions are normalized and rigidbody physics are in fixedupdate... only thing I can think to do is adjust drag to make sure that the player isn't moving fast enough to get a heavy position change from rotation. I'm about to test that out but I don't think that will actually fix the issue. just prevent speed gain from the rotation..

#

Kind of a ridiculous question but using both input systems in this case wouldn't have anything to do with it right?

restive crane
#

Kind of fixed it. I tried putting the orientation and inputdirection components into Fixed and Late update (not both just tried the two) with some linear damping and that seemed to help the issue somewhat.

royal tartan
#

If you're rotating in FixedUpdate you need to accumulate the mouse input in update and consume it in FixedUpdate

#

And then you need to be rotating in an interpolation friendly way

#

Can you show your code

restive crane
#

Yes uno momento

#

public class ThirdPersonCam : MonoBehaviour
{
    // Script for third person camera.

    public Transform orientation;
    public Transform player;
    public Transform playerObj;
    Vector3 viewDir;
    Rigidbody rb;
    public float rotationSpeed;
    private float verticalMovement;
    private float horizontalMovement;


    // Start is called once before the first execution of Update after the MonoBehaviour is created
    void Start()
    {
        Cursor.lockState = CursorLockMode.Locked;
        Cursor.visible = false;
    }

    // Update is called once per frame
    void Update()
    {
        GetInput();
        Debug.DrawRay(player.position, viewDir, Color.red);
    }
    void LateUpdate()
    {
        viewDir = player.position - new Vector3(transform.position.x, player.position.y, transform.position.z);

        // Sets orientation transform to view direction
        orientation.forward = viewDir.normalized;

        // sets player objects direction to orientation direction
        Vector3 inputDir = orientation.forward * verticalMovement + orientation.right * horizontalMovement;
        if (inputDir != Vector3.zero)
        {
            playerObj.forward = Vector3.Slerp(playerObj.forward, inputDir.normalized, Time.deltaTime * rotationSpeed);
        }
    }

    private void GetInput()
    {
        verticalMovement = Input.GetAxisRaw("Vertical");
        horizontalMovement = Input.GetAxisRaw("Horizontal");
    }
}
#

public class PlayerController : MonoBehaviour
{
    Rigidbody rb;
    public float movementSpeed;
    public float jumpHeight;


    public Transform orientation;
    public Transform player;
    private float verticalInput;
    private float horizontalInput;

    Vector3 movementDir;
    public float playerHeight;
    bool isGrounded;
    void Start()
    {
        rb = GetComponent<Rigidbody>();
        rb.freezeRotation = true;
    }
    void Update()
    {
        isGrounded = Physics.Raycast(transform.position, Vector3.down, playerHeight * 0.5f + 0.2f);

        if (Input.GetButtonDown("Jump") && isGrounded)
        {
            rb.AddForce(Vector3.up * jumpHeight, ForceMode.Impulse);
        }
        MyInput();
    }
    void FixedUpdate()
    {
        MovePlayer();

    }
    private void MyInput()
    {
        verticalInput = Input.GetAxis("Vertical");
        horizontalInput = Input.GetAxis("Horizontal");


    }
    private void MovePlayer()
    {
        movementDir = orientation.forward * verticalInput + orientation.right * horizontalInput;
        rb.AddForce(movementDir.normalized * movementSpeed, ForceMode.Force);

        if (movementDir != Vector3.zero)
        {
            player.forward = Vector3.Slerp(player.forward, movementDir.normalized, Time.deltaTime * 5f);
        }

    }

}
#

I haven't cleaned up the code yet, sorry abt that

royal tartan
#

Ok so you're directly modifying your Rigidbody's Transform

#

That's a problem

#

It's going to break interpolation

#

You need to be only touching the Rigidbody

#

You're also changing it in both Late update and fixed

restive crane
#

And changing the orientation in fixed and late with both scripts, I see what you mean

royal tartan
#

Oh that's even worse you have multiple scripts doing it too

restive crane
#

Nvm I see what you're saying and understand it now, thank you.

ivory wraith
#

@cursive spindle answering #💻┃code-beginner message in here:

Nothing has changed about how priority works. I think the idea is to nudge you to use things other than priority to control which camera goes live.

#

For example, in my game, I have a camera controller that decides which camera is supposed to be live, and all of the other virtual cameras are turned off

#

Priority can be a bit janky. If you increase a camera's priority to 10 so that it beats a camera with a priority of 5, it'll also start beating other cameras with priorities in the 6-9 range

wispy sun
#

Can anyone help me get the cinemachine input axis controller to work? The only thing working so far is the default map that came with it. I've tried setting the scroll wheel but it has zero effect and I can't figure out why. Additionally, when I set it to the scroll wheel, the input value field changes when i scroll, but the camera does not move

cosmic dust
#

can someone help me out with a camera issue?
im using cinemachine to follow the player, but for some reason the camera's only rendering my background colour and nothing else, and theres no code interacting with the camera.

heres how it should look:

royal tartan
#

and what position is your camera ending up having?

#

Make sure the z position of the camera is not the same as that of the player

cosmic dust
fading talon
#

Hey all, using cinemachine for a third person spectator camera. When a player dies, the player's main camera swaps to an orbital third person camera positioned on another player. When I disable the first person camera and enable the spectator camera, there's this weird smooth pan between the two. How do I remove that?

fading talon
#

Exactly what I was looking for, thanks!

fast quest
#

I'm having issues that I need help with, my camera is moving on its own slightly

#

nvm i'm dumb, it was from the peril noise that I got from the unity first person start asset that

wispy sun
#

I had the same problem, it was that and the other time I had an xbox controller leaning on one of the sticks

pseudo tinsel
#

i'm trying to have a dynamic camera for dialogue that puts the person talking around the center of the screen and the person listening near the left. one weird requirement i have is that it has to work at any angle, so if both the people are upside down or on a wall, the camera is at their average angle. i've been trying it with the target group follow extension, on regular ground the position and rotation arent as consistent as id like it (id like them to be in the exact same place every time if possible), and on tilted/upside down ground the rotation doesn't seem to work at all. i'm probably doing something completely wrong because i'm new to cinemachine, any advice?

cerulean ore
#

Hello. I am having a problem with Cinemachine cameras. I currently have two Unity cameras (P1Cam and P2Cam) each with a Cinemachine Brain component, and two cameras (P1CamBrain and P2CamBrain) that are Cinemachine cameras with Cinemachine Virtual Camera components, Cinemachine Orbital Follow, and Cinemachine Input Axis Controller. My problem is that when I start the scene, I can freely move the Player 1's camera, but not the Player 2's. And when I restart the scene using scripts, I can now move the Player 2's camera and not the Player 1's. Player 1 uses an Xbox Controller with it's own controller scheme and Player 2 uses keyboard and mouse. Any help?

royal tartan
#

you'd have to show how you hooked everything up

cerulean ore
royal tartan
ebon charm
#

im getting this after installing cinemachine

#

on unity 6.3

#

inspecting the code it seems like something for urp and im on hdrp so i just removed it 🤷‍♂️

feral shadow
#

So I'm trying to make third person cam and first person cam look the same direction when switching, but they don't match and I don't know what's the problem

third person cam uses cinemachine
first person uses a regular camera

I use this code to make them match, but third person goes back to where I left it, and first person just goes to default
FP_Cam_Transform.rotation = MainCamera_Transform.rotation; (on third person script when enabled)
MainCamera_Transform.rotation = FP_Cam_Transform.rotation; (on third person script when enabled)

opal steeple
feral shadow
#

Gonna take a look, thanks

sharp mountain
#

Anyone got a good Idea on how I can add a trigger to switch to a different camera.
context, I'm doing a turn based RPG esc style, and there is an overworld, and an Arena world.
What I'm trying to do is that when the player collides with a rigid body that has the "Enemy" tag, it switches over to CombatCam, that way I don't have to make CombatCam a child of the the rigidbody that uses the "Enemy" tag.

#

i'm pretty new to programming in general so i've been wracking my brain over how to actually do this

royal tartan
vapid cedar
sharp mountain
#

Lemme grab the video, it has the code inside

#

Main issue is, by taking the camera off as the child to enemy, it'll no longer work and I have idea why

sharp mountain
#

Unless someone else has a different way of doing it

royal tartan
#

Also please - don't share code in a video

#

very hard to read that way

#

!code

hidden krakenBOT
sharp mountain
#

Apologies, only way I could, not home

sharp mountain
#

Since the idea is persona esc, you walk into an enemy, and it sends you to combat

#

If there are 3 enemies in the area, would it better for those 3 enemies to have their own camera directly in the same spot? Which would be the combat arena?

#

Like, what's seen in the video, the camera switches to a combat camera in a different version of the map, is it not gonna cost me resources to have 3 of those guys duplicated?

royal tartan
#

Cinemachine cameras are intended to be used liberally

#

they cost next to nothing when they're not active

sharp mountain
#

Oh

#

So having each enemy copy have its own camera might not actually be that bad?

#

And I'm going through the struggle of having each enemy tied to one camera system for no real reason?

#

Which means I can just continue to work on the fundamental systems instead of getting stuck on one thing

#

I think I have that right?

feral shadow
# vapid cedar You need a script to make the MainCamera Keep same rotation as ur virtual camera...

xRotation keeps defaulting to 0, so the cam always looks forward
I followed this tutorial for first person cam
https://youtu.be/f473C43s8nE?si=MJda8A1lk9IjhInV

FIRST PERSON MOVEMENT in 10 MINUTES - Unity Tutorial

In this video I'm going to show you how to code full first person rigidbody movement. You can use this character controller as final movement for your game or build things like dashing, wallrunning or sliding on top of it.

If this tutorial has helped you in any way, I would really appreciate...

▶ Play video
naive oyster
#

any idea why my cinemachine camera won't rotate? i'm using third person follow and hard look at. if i disable the third person follow, it'll rotate to point at the tracking target cause hard look at. it forces all rotations to be 0 with third person follow enabled

royal tartan
#

the answer to "why is my cinemachine camera doing XXX" is usually "because that's how it's configured"

naive oyster
#

like a screen grab of the inspector for the cinemachine?

royal tartan
#

sure

naive oyster
#

trying to make a strategy game type camera where it orbits around an anchor

#

i could look up a guide on youtube but i'd rather try debugging it first

#

i'm using 6.3 if that helps

#

it broke in 3.1.4 to 3.1.5 i was copying my old project and tried updating old project's cinemachine

#

now to figure out if i can downgrade cinemachine or if i have to make do

naive oyster
#

so turns out it forces the camera to copy the tracking target's rotation

#

the third person follow is in position and overwrites the rotation component

royal tartan
#

If you hit this gear thing

#

you can set separate Follow + Look targets

naive oyster
#

witchcraft

#

lol ty i see it now

#

i had gone to use an orbital follow control which works similar but has it's own quirks

#

eh it still forces the camera to have the same rotation as the tracking target while third person follow is active not allowing hard look at to work. i'll keep to the orbital follow for now

dim goblet
#

Does the new Cinemachine decollider not work with concave mesh colliders? Mine seems to be working just fine with box colliders but not the walls in my room, which is just a ring of inward-facing quads. They're all on the same layer.

royal tartan
dim goblet
#

Where do the rays cast from? The walls are face the camera, so if the rays are cast from the camera's location then they should hit the walls.

royal tartan
dim goblet
#

Sorry, Maybe I described it wrong. The camera is in the center surrounded by quads that face the camera. I meant they are inward facing in that sense. The mesh collider is like an inside-out cylinder with the camera inside.

royal tartan
#

IIRC, the rays go from teh camera towards the thing the camera is looking at. Once the camera leaves the box it will be outside this inward-facing box so those raycasts wouldn't hit anything

dim goblet
#

Yes, exactly. It's just an interior scene and I don't want the camera to get outside of the room. If the camera were outside the room, then there would be nothing for the raycast to hit, but I would have assumed that the decollision component would prevent the camera from getting outside in the first place.

dim goblet
#

Actually, the more I work with Cinemachine 3.1.4, the more frustrating it is. I had the perfect camera set-up with just a few clicks in Cinemachine 2, but with 3.1.4 I just can't figure out how to get the behavior I want with all these weird settings whose names don't mean anything to me. I don't see other people complaining, so maybe it's just me.

reef pecan
#

trying to limit the camera, I made a boxcollider around the whole map that is pretty small. I had to assign "Ignore Raycast" layer. The view gets stuck inside the box but the Camera it self can still walk even futher outside of the map. How would I go around this?

weak jay
#

hi, I've always used regular cameras and would want to use cinemachine cameras now especially to add a hiding system in my game with blending with a first person controller, I've watched some tutorials but very a few of them show what I'm looking for, most of the FP person controllers setup I have are simple Character Controller and a child camera, how could I achieve what I want simply?

late basin
# weak jay hi, I've always used regular cameras and would want to use cinemachine cameras n...

There are many ways to do FP with Cinemachine. The simplest way for you would probably be to continue using your Character Controller script, almost exactly as-is. Just replace the Camera component with a CinemachineCamea component, and update the script to expect that rather than Camera. In the CinemachineCamera component, set all the procedural stuff to "none". That way, the CinemachineCamera is 100% controlled by your script (as before) but the difference is that now it's part of the Cinemachine ecosystem and can participate in blends etc. You can also add procedural noise and CinemachineExtensions if you want. You'll need to create a separate Camera GameObject, and add a CinemachineBrain component to it. See here for a general overview of how CM works: https://docs.unity3d.com/Packages/com.unity.cinemachine@3.1/manual/concept-essential-elements.html

weak jay
# late basin There are many ways to do FP with Cinemachine. The simplest way for you would p...

I've just finished reading the most important parts of the documentation, but I didn't really find how to blend from one camera to another the best way via script, they just tell that you can set a cinemachine camera to live in the inspector and also with the priority values, if I want to make a hiding system, how should I do it? I'd like to blend from the fps cam to a non moving cinemachine camera with a function and then comeback to the fps cam with a function too

#

should I just change the priorities ? via script

late basin
# weak jay should I just change the priorities ? via script

You can manipulate the priorities by script, or activate/deactivate CinemachineCamera GameObjects. It's up to you how you want to organize things. If you have multiple active CM cameras, the one with the highest priority will take control. If there are multiple CM cameras with the same highest priority, then the most-recently-activated one will win.

pulsar mason
#

Hi, my artist can't update CM to CM 3 in his machine, even tho i've updated it to CM 3 and pushed in the repo

#

Anyone know why the option to update to 3 doesn't show up?

#

It only says update to 2.105

late basin
late basin
pulsar mason
#

I did push the manifest yes

pulsar mason
late basin
royal tartan
kindred lintel
#

So when I am testing in game with a cinemachine camera set up, the borders of the game window seem to be flashing white for some reason. Any idea why?

tranquil berry
twilit pier
#

Hey everyone, running into a CM problem that I think may be quite common. Essentially I have set up a free look camera CM with the new 3.1.4 package and it works pretty well except for one thing. Since the rigidbody movement of my character is also depending on the camera forward vector and I rotate that character also depending on this camera transform vector I can see jittery movement when my character moves forward and rotates only with the camera rotation.

So I make my character move forward, I slightly rotate the camera to the right and I can see that it jitters and doesn't rotate smoothly.

I have tried a bunch of things:

  • Setting interpolate in the character Rigidbody.
  • Changing the update method on the CM brain.
  • Decoupling the moment I access the camera transform vector in another update method and caching it for usage in the FixedUpdate method or LateUpdate.
  • Tried setting the Position Damping of the CinemachineOrbitalFollow component all to zero.

Nothing works properly and I can't get smooth jitter-free rotation as you can see in the video.

DISCLAIMER: In the video it seems even more than what it is probably to lower frame rate, but it's still pretty evident.

Here is the code that handles the rotation. This is called from the WalkingState's Fixed Update (also tried LateUpdate):

    if(_player.movementInput.magnitude > 0.001)
    {        
       Vector3 cameraForward = _player.cameraForward;
       Vector3 cameraRight = _player.cameraRight;
       Vector3 direction = cameraForward * _player.movementInput.y + cameraRight * _player.movementInput.x;
       direction.y = 0;
       _lookRotation = Quaternion.LookRotation(direction);
     }
     _targetRotation = Quaternion.Slerp(_player.rb.rotation, _lookRotation, _player.rotationSpeed * Time.fixedDeltaTime);
     _player.rb.MoveRotation(_targetRotation.normalized);
}```
royal tartan
#

Wait actually - all of this is kinda confusing for me

#

Where are these coming from:

       Vector3 cameraForward = _player.cameraForward;
       Vector3 cameraRight = _player.cameraRight;```
#

are those direction vectors?

twilit pier
# royal tartan Can you show: - Where this `_player.movementInput` comes from? How is it popula...

Those are all coming from the PlayerController mother class of the StateMachine essentially. A container that handles state transition and setting up of variables.

The movementInput is generated from the PlayerInput component and invoking the HandleMoveInput method. In the Update I then get the cameraTransform.forward/right and assign them to the variables. Initially I was doing this step directly inside the rotation function, but then I decoupled it to test out wether it would fix something. I hope you can see properly from the screenshot, if not I'll paste the text

royal tartan
#

well, camera rotation mixed with the walking direction of the player

twilit pier
#

Yeah exactly

#

Was about to mention the mixing with the walking direction

#

Could this mixing be an issue? I wouldn't think so

royal tartan
#

I would try this:

     Quaternion newRotation = Quaternion.RotateTowards(_player.rb.rotation, _lookRotation, _player.rotationSpeed * Time.fixedDeltaTime);
     _player.rb.MoveRotation(newRotation);```
#

How is your camera rotation handled exactly? Through Cinemachine components?

#

Oh wait, also one major piece of the puzzle - does your player's Rigidbody have interpolation enabled?

royal tartan
#

And you're rotating through cinemachine?

twilit pier
twilit pier
royal tartan
twilit pier
#

In any case I am rotating the camera only using cinemachine components, an extra thing I added was a customInputHandler script because otherwise I would have too different sensibilities for mouse rotation and controller rotation:

twilit pier
royal tartan
#

Oh actually I bet it's probably causing rotation just VERY SLOW

#

Can you try increasing _player.rotationSpeed?

#

like, a lot 😛

#

SOmething like 50 or 100 would be a good value @twilit pier

twilit pier
#

Yeah ahahah literally just fixed it

#

So yes, increasing it to 1000 did the trick

#

But the jittery when moving forward and changing direction with the camera is still there

royal tartan
#

Ok I have another suggestion for you:

  1. Move the rotation code to LateUpdate instead of FixedUpdate
  2. Change the code to:
Quaternion newRotation = Quaternion.RotateTowards(_player.rb.rotation, _lookRotation, _player.rotationSpeed * Time.deltaTime);
_player.rb.rotation = newRotation;```
twilit pier
#

Done and it made the problem worse as now it's jittering even when walking normally in any direction. Tried changing the update methods of the CM brain, but nothing. Removing interpolate in the rb helps a bit (still doesn't fix the original problem), but I know it is not optimal in this case and I think I will need it in the future in any case

#

I really can't wrap my head around this issue

royal tartan
#

I'll be honest in your video above I didn't actually see any "jittering"

#

so maybe what you're describing as jittering is something else

twilit pier
royal tartan
twilit pier
#

I actually have, all three axes

#

Is that an issue?

royal tartan
#

that's good

tight lichen
#

how do I make my camera only track my player on the x axis?

royal tartan
kindred lintel
#

2 questions for people who make third person cameras with cinemachine:

  1. How do you make a perfectly spherical camera orbit (with some logical vertical clamps)
  2. What do you personally like in your third person cameras and how do you achieve that (don't need to be super detailed, just basic ideas)
cursive cape
#

Hello i ask for help in unity chat and they told me to go here

#

How to fix this

royal tartan
hoary sentinel
#

What happened to simple follow with world up option? Trying to override the world up in brain to players up and have this freelook rotate with it but the lock to world up rotates the camera to follow the player which is wrong

#

For a spherical gravity controller

hoary sentinel
#

is there a reason that i cant see that in the spherical camera demo scene for cinemachine, the lock to target mode doesnt auto rotate the camera to the players fwd?

acoustic briar
#

Anyone here think they could help me with changing the Horizontal Axis of a freelook camera in a script?

#

specifically the Horizontal Axis Valuei nt he Cinemachine Orbital Follower

royal tartan
acoustic briar
#

what do I call to directly change the Horizontal Axis Value

acoustic briar
#

ok I put public InputAxies HorizontalAxis in, but when I get an error when I do HorizontalAxis = 90;

royal tartan
#

also you probably don't want or need a field for this.

acoustic briar
#

why? Then how will it know I want to change the Horizontal Axis?

acoustic briar
royal tartan
acoustic briar
#

thats what the link told me to do

royal tartan
#

you need to change the value on your CinemachineOrbitalFollower component

royal tartan
#

the documentation is simply describing the field that exists on CinemachineOrbitalFollower

#

it's not telling you what code to write

#

documentation describes the existing code

royal tartan
#

here, you probably need an example

acoustic briar
#

ok then, forget the InputAxis what do I need to put in to change the value on a CinemachineorbitalFollower Horizontal Axis?

royal tartan
#

Example:```cs
// Assign this to your orbital folloer component in the inspector
[SerializeField] CinemachineOrbitalFollow orbitalFollow;

void SetAxisAngle(float angle) {
InputAxis axisData = orbitalFollow.HorizontalAxis;
axisData.Value = angle;
orbitalFollow.HorizontalAxis = axisData;
}```

acoustic briar
royal tartan
#

Where else would code go?

acoustic briar
#

Well I put it in and I'm getting errors so I'm checking

royal tartan
#

what errors are you getting?

acoustic briar
#

Says the namespace CinemachineOrbitalFollower could not be found

royal tartan
#

it's not a namespace

#

That's definitely not the whole message

#

show the code you tried and show the full error message

acoustic briar
royal tartan
#

Ok read the full message in the future

#

But yeah it's not CinemachineOrbitalFollower

#

it's CinemachineOrbitalFollow

acoustic briar
#

I see

royal tartan
#

Also you didn't quite copy the code structure correctly

acoustic briar
#

yes I noticed I fixed that

#

it seemed it autocorrected it alot and I didn't see

royal tartan
#

anyway this code isn't going to do anything on its own, you'd need to actually call this function with whatever value you want to actually set to it

acoustic briar
#

got it thank you

acoustic briar
#

Ok, now I'm having trouble figuring out how to access the Input Value in Cinemachine Input Access Controller

mental apex
#

I have a Spline, I want the camera that follows the spline - to have the rotation the same as the knot rotation.
is that possible?
the camera seems to always require a lookat target.

#

the spline dolly look at targets requires lookat targets

pulsar mason
#

Hi i'm having a weird problem. The transform component of my camera is like this and a bunch of errors is freezing my editor

#

After a while, editor crashes

#

Posting here bcoz it may have something to do with cinemachine

#

Nvm, reset editor layout and that fixes it i guess

#

Btw another thing. My virtual camera's rotation is something (30,90,0)
But my camera CM brain object's rotation has different value
It's not a big problem if they're actually poiting to the same and same up direction
But sometimes the difference ends up having random small values

#

Like these
And i see it starts changing bcoz i guess the Deoccluder feature. It adjusts when it hits some collider otw
But when the camera completely moves out of the occluder, it doesn't return to the original rotation
The tilting adds up and eventually my camera's not in the same rotation (among others, the Y rotation) anymore

royal tartan
urban otter
pulsar mason
#

I also notice my deoccluding behaviour also involves a "steering" kinda tilt. Like, Z axis rotation (camera view wise) that doesn't always return to 0
And only happens when the deoccluding. When there's no occlusion, this Z tilt doesn't happen

royal tartan
#

generally in cinemachine it doesn't make a lot of sense for either cinemachine cameras or the main camera to be children of anything

pulsar mason
#

I mean it used to work just fine. Forgot when but definitely before i upgraded to CM 3

pulsar mason
#

I've confirmed that even when the VC and the camera (with CM brain) has no parent, this behaviour still happens

#

Ya actually there is no Z rotation. Just X and Y

#

Why can't the deoccluder just zooms in until it gets out of the occluding object? And not do any rotation at all?
My deoccluder's strategy is already "Pull Camera Forward"

pulsar mason
#

Dampinig when occluded to 0 do help prevent this tilting, but still not fully gone

pulsar mason
#

I guess i gotta revert back to CM 2

hoary sentinel
#

Been trying to solve this for a day and asked previously but couldn’t solve.

#

Anyone know what replacement for this is in cinemachine 3?

#

Have the brain camera overriding world up, but in the rotation composer, I don’t want the camera auto locking to the players fwd direction all the time

#

Or anyway to disable the yaw rotation in lock to target?

hoary sentinel
#

also in this cinemachine demo they have the orbital binding mode set to lock to target yet the camera doesnt rotate towards the players forward which the docs say is supposed to happen

acoustic briar
#

Hi! I'm trying to figure out how to detect mousemovement using the InputValue in Look Orbix X but I'm having trouble figuring out how to check that variable in a script

acoustic briar
#

I've tried this but I'm getting errors

pulsar mason
# pulsar mason I guess i gotta revert back to CM 2

Hi just making sure. I had CM 2, updated to CM 3 but having issues
I'm on unity 2022.3.55
I only somehow updated to CM 3 bcoz a dependency of a unity asset requires (recommends?) to update to CM 3

Now that i see in the package manager, CM 2 is still the "Recommended/Release" and there's no label on CM 3
When i downgraded, CM 3 no longer appears as an option in the package manager

#

So my question is basically, is CM 3 still experimental? Or it's not recommended for unity 2022?
Can anyone confirm that CM 2 is still much more stable and reliable in general, specifically for unity 2022 or in general?

late basin
pulsar mason
#

The deoccluder is not behaving properly. As in, i have to consider it broken even
Related thread https://community.gamedev.tv/t/cinemachinedeoccluder-behaviour/253065/7
Altho i don't understand his last sentence in the last paragraph

One caveat, however, is that it appears that the DeOccluder doesn’t memorize where it was when you encountered the occlusion… this means that for something like a freelook camera, the return position may not be where it was when you started. It should return to a calculated position based on the positioning component’s calculations. (This was actually true of CM2’s CinemachineCollider as well)
Does he mean the original position also gets forgotten in CM 2 ? Or it works properly in CM 2?

#

I just confirmed, i downgraded to CM 2 and did all the changes back, and this deoccluder (it's called CinemachineCollider) behaves properly. No accumulating tilt on rot X/Y, and no "steering left/right tilt" behavior either (which i think is from the DampingWhenOccluded. But i turned this to 0 and in CM 3 it still damps, while in CM 2 it's properly 100% snapping and not accumulating tilt)

acoustic briar
mental apex
# acoustic briar I've tried this but I'm getting errors

I think you shouldn't touch the input axis controller.
It auto feeds the values to the other Cinemachine components. (in the manual they are called axis drivers)
so you are probably looking for the values from the CinemachineCamera or it's components

upbeat owl
#

Can someone explain to me why the Material Converter, ALSO converts Cinemachine across all scenes suddenly with no warnings?

errant shard
upbeat owl
# errant shard What do you mean by "converts" cinemachine?

I ran the material converter and suddenly my console was spewing out that something found a cinemachine game object without a spline or adding a dollycart spline to a game object that had a script on it that referenced it and such (see screenshot). It was absolutely bonkers additions to and since I have many cinemachine components in my app, it made a mess of it all. I never asked for it and it never even warned me that cinemachine updates were part of the material conversation process. Perhaps it was a bug that caused the converter to trigger a reimport of cinemachine components? No idea but I had to go to a backup and lost 90 mins in the process.

#

Just prior to this I did a Library reimport and none of these issues came up and they are not even issues to worry about. Was a very odd experience.

errant shard
#

Rather the whole asset importer process crashed and broke a bunch of things

#

Some crashes with the error code 10054 you have there were fixed in newer patches of 6000.0. in case you're using an old one

vivid walrus
#

hello,how could I make a lookat transform system with cinemachine camera, the virtual camera should rotate and look at a specified transform during a specified time and then rotate back to its original rotation?

errant shard
vivid walrus
errant shard
#

And by default it does a smooth blend to another CM cam when the active one is disabled

vivid walrus
# errant shard <https://docs.unity3d.com/Packages/com.unity.cinemachine@3.1/manual/ControllingA...

sorry to disturb you again, but I just did it, made another virtual camera with higher priority, set it unactive in the scene, once I want this cam to lookat the transform, I set the camera active for a float amount of time, I disable the PlayerMovement script too and then I simply set it unactive back but this doesn't work as expected, the rotation never does so,I just added the transform to the lookat in the component btw

errant shard
#

Specifying a target is not alone enough, at least not in CM3, you also need a CM component to use the target for a particular kind of rotation

vivid walrus
errant shard
vivid walrus
#

you said I'd need a CM component too and I have one..

errant shard
errant shard
# vivid walrus cm3

Yes, like I said it's not enough to specify a look at target because you don't additionally have a component on the CM camera to specify what to do with the look at target, as there are many ways to "look at" something

#

When you set a Rotation Control or add an extension it will add a CM component

#

You probably want a Rotation Composer or Hard Look At as the Rotation Control

#

CM components are different from the CM camera component, I don't blame you for being confused

vivid walrus
errant shard
#

You may need to tweak the settings for it to work as you hope, but likely yes

vivid walrus
#

when you said CM component I thought you meant the CM camera component lol which was also why I was confused

errant shard
#

You can also import sample scenes from the package manager for CM, which will show exactly what kind of camera actions can be achieved and how

vivid walrus
errant shard
acoustic briar
#

How do I make it so that the cinemachine free look camera moves based on a leftmousebutton being held down?

acoustic briar
#

like I only want the camera to move if the left mouse button is pressed and the mouse moves

unreal wadi
#

How do I create a camera that follows the player only when they're towards the edge of the screen? I saw someone doing this with "dead zones" in a tutorial just now, but it looks like they were using an old version of Cinemachine that has some differences. the dead zone part on my camera doesn't seem to do the same thing

unreal wadi
#

nvm I figured it out, I had picked the wrong camera and the dead zone variable in that one was affecting something else I guess

errant shard
#

The server's not a place to solicit work

late vine
#

I recently updated from Unity 6 to Unity 6.3 and I noticed the Deoccluder stopped working, I opened up the script and noticed the enitire #if CINEMACHINE_PHYSICS section is now grayed out. The project sample works, but my scene implementation doesn't work... I'm missing something post-upgrade but can't figure it out

royal tartan
#

is PhysX enabled?

late vine
# royal tartan is PhysX enabled?

So after some testing this morning, there's some kind of bug in CM 3.1.5 where the Deoccluder component is ignored with the CM Third Person Follow component and requires you to check "Use Follow Target". However, if you check that, you get a really poor occluding result with some clipping and poor quality for handling camera distance, likely due to new damping code.

After falling back to 3.1.2 (which is what I was using before the upgrade to 6.3LTS), the issue resolved itself.

So I guess if anyone is trying to use the Deoccluder with the Third Person Follow is going to run into this as well. You can use the "avoid obstacles" in the TPF component as well, but it's not as graceful as the Deoccluder.

ivory wraith
#

I wonder if I'm the reason the "Use Follow Target" option was added in the first place (i asked about it in the Cinemachine forums after editing the package to add that)

#

so uh, i guess this is my fault 😉

late vine
#

Probably should have tagged Gregory but don't want to bother the dude... I bet he's the only dev working on CM as it is. 😓

bright nova
#

im following a cinemachine tutorial and the tutorial author is able to visually see the geometry of the orbital follow, whereas I have the same setting and am achieving the same functionality but do not see the same thing in my scene preview. Screenshots attached. Is there some setting or something I'm missing?

errant shard
bright nova
errant shard
royal mason
#

Guys I am just starting to use Unity and I know this is probably the most noob question but how to I get into the scene view? I don't really know what I did but I can't scale and rotate around the 3d scene like I was able to do in the tutorials. I'm guessing I'm in 'Game View' or something. I can't click the cube I created to make adjustments, and I can't change my camera view.

royal tartan
vestal hedge
#

Why does it look so choppy when the cinemachine tracks an object

royal tartan
#

And/or your object's movement is actually choppy

vestal hedge
#

It wasnt choppy until I did the cinemachine thing.

royal tartan
#

THe most common issue is Rigidbody motion without a proper interpolation setup and/or code breaking the interp

vestal hedge
#

ohh ok

plain warren
#

can we change clipping planes in cinemachine camera. i am unable. the value reverts back to default on changing.

plain warren
#

Bro i try sliding it doesn't change. I enter a value and it reverts to default

#

Why is this happening?

errant shard
#

Where are you changing it exactly, and to what value

plain warren
#

near and far clipping panes

errant shard
#

You have to change it in your cinemachine camera

plain warren
#

in cinemachine brain? or cinemachine camera?

errant shard
#

Cinemachine camera

plain warren
#

i cant find it

#

oh yeah its under lens

#

damn should have looked for it before

#

thanks though my issue is resolved now

#

it was so obvious

errant shard
#

I guess less obvious now that cinemachine cameras are no longer called "virtual cameras"
So no confusion about whether CM cam refers to the real camera, the brain or a virtual camera

plain warren
#

i have another issue but its not related to cinemachine. my unity is crashing a lot. i am using hdrp and my ram is 16 gb. it crashes even when i open one tab of youtube in side.

#

so i cant follow tutorials properly

#

the fact that its not crashing with discord is such a life saver

#

i have a 3050 laptop. is it normal for this hardware?

errant shard
#

Crash logs may reveal something
I had 16 GB ram and easily had multiple unity projects open, HDRP or otherwise, while using other programs at the same time

plain warren
#

i barely can run a single

#

😭

#

i thought it was a ram issue

#

also i have a laptop if that makes any difference

#

AND IT CRASHED AGAIN LMAO!

errant shard
#

I wouldn't blame ram for it primarily
Could be due to anything

#

Maybe even something with your particular editor version or project, rather than unity itself or your hardware

cold orchid
#

im using this configuration for an orbital camera which only moves if i click and drag the screen, but i want the camera to permanently move with the mouse, i was told to rebind to mouse delta but that doesent seem to work or register

gloomy aspen
#

hello, i have a problem in cinemachine where is my cinemachine seems like its running on 60 fps even though i have 400 fps what maybe the problem

gloomy aspen
#

hi guys i still have the same problem its very choppy

errant shard
#

So, make sure your CM camera is in smart update
Make sure your rigidbodies have interpolation on
Make sure your code isn't overwriting the position of any rigidbodies, or moving objects in fixed update

gloomy aspen
errant shard
gloomy aspen
errant shard
gloomy aspen
#

i mean the camera rotation

errant shard
#

So, everything is totally still except for the moving camera?
What is moving the camera

gloomy aspen
#

i had it late its laggy in smart its also same

#

changed the blend still same issue

errant shard
#

And potentially verify how the issue is manifesting
The editor can jitter for reasons unrelated to what's happening in your project

#

Compare to movement of something that verifiably is moving in Update

fair tiger
#

I am making headbobbing using different noise profiles. I was going to use multiple camera's so it transitions between them smoothly but I want to know if I can just use one camera and is it possible to smoothly transition between the noise profiles.

royal tartan
fair tiger
spare steppe
#

hello , i'm trying to use cinemachine dolly track and i'm trying to switch the speed but i can't seem to be able to call it with public reference.

does anyone know where i could find information about that cause i can't seem to find it.

worldly plover
#

Is there a way to force Cinemachine to only pan horizontally? I have a series of objects placed side by side horizontally and a menu from which I can select them. Once a different object is selected, the camera should pan horizontally only.

I can achieve this by using a "Rotate with follow target" as the rotation composer, but then I lose any ability to rotate the camera.

errant shard
worldly plover
spare steppe
#

can the fixed speed on the cinemachine spline cart be changed in script?

nvm found how

hidden krakenBOT
#

success @artemka09470 muted

Reason: Sending too many attachments.
Duration: 29 minutes and 41 seconds

wintry canopy
#

This is an English speaking community.

fair tiger
royal tartan
#

you're probably doing the rotation through the camera only or something

royal tartan
#

the Player object is not rotating

fair tiger
royal tartan
#

it will rotate automatically when its parent does

fair tiger
#

Oh shit your right I was a bit confused at the beginning lol. When I rotate my player object the headbob is rotating properly now.

dreamy nova
#

Hey, is there a way to set the Tracking Target on the cinemachinecamera through a script?

fair tiger
dreamy nova
#

thanks

warm verge
#

how do you make fps camera in the unity 6 like chinemachine camera should i use

pearl plume
#

Idk, if somebody already answered, but how in 2D make camera move in player momentum direction? Using follow and make camera drag is bad approach

royal tartan
warm verge
#

in presiouv version there used to be a script for the main camera to do so but its not there anymore

kindred lintel
#

Anyone got any good links to how cinemachine 3 operates? I'm getting major whiplash going to the new version. Already looking at the docs.

warm verge
kindred lintel
warm verge
kindred lintel
#

The one I'm looking at is third person

warm verge
#

check for first person to

kindred lintel
#

I don't recall any fps ones though

#

Not explicitly named, but maybe there's one that can be adapted to an fps

kindred lintel
#

I'll take a look

warm verge
kindred lintel
warm verge
#

the free look ones might work but i can't be sure

kindred lintel
#

Granted, I think fps games wouldn't need cinemachine? Usually when I do an fps I just make the camera a child of the player and control its rotation directly

warm verge
kindred lintel
#

Ah, yeah that make sense

warm verge
#

plus i don't think it will be that good for multiplayer

kindred lintel
warm verge
#

no worries i found one in the unity projects to if i find anything i will tell you

kindred lintel
#

Gotcha, appreciate it

warm verge
#

i actually didn't find any so i decided to make my own version

warm verge
# kindred lintel Gotcha, appreciate it

this is how i did it. its self closed so can be turned into a prefab the chinemachine, the camera refrence target and everything is in a single gameobject and refrence eachother so as long as the chinemachine exists in the chidren it will get the camera on its own without any problem

#

turns out they are also using there own custom script for first person. there is chinemachine camera build for first person at all

royal tartan
#

First person look scripts are very common and simple

kindred lintel
warm verge
warm verge
paper bridge
#

Im building for android and i want the binding mode of my camera to be lock to target, but when i try and build, the camera behaves as it is on lock to target on assign, which is the complete opposite of the behaviour im looking for, why is that?
Can android even run for this way of handling my camera?

#

It works fine when i play in the editor btw...

errant shard
paper bridge
potent flame
#

Am I misunderstanding how cinemachine volume settings work? I have multiple cinemachine cameras with different postptocessing profiles used in their volume settings components. I can switch between them and everything works great. I also use a screen space overlay UI which is getting distorted by the various cameras. I don't want that. So I've setup a secondary ui camera, put my ui on a layer set the main camera to ignore ui, the secondary to render only ui and added stacking. The stacking works correctly and my secondary camera renders the ui, but it's still affected by the base camera's post processing! Is this expected? is there a way around it?
(ok, so turning off postprocessing on the ui camera is partially what I want, but ideally I'd like seperate postprocessing sets for both cameras?)

frank escarp
#

Every time i try to assign a cinemachine brain component to my main camera, it stops my camera zoom code from working. I need cinemachine attatched to the main camera because i'm trying to make it so that the camera can't go out of bounds.

Here is the code it breaks.

using System.Collections.Generic;
using System.Collections;
using UnityEngine;

public class CameraZOOM : MonoBehaviour
{
private Camera _camera;
private float zoomtarget;

[SerializeField]
private float multiplier = 2f, minzoom = 1f, maxzoom = 12f, smoothtime = .1f;
private float velocity = 0f;
void Start()
{
    _camera = GetComponent<Camera>();
    zoomtarget = _camera.orthographicSize;
}
void Update()
{
    zoomtarget -= Input.GetAxisRaw("Mouse ScrollWheel") * multiplier;
    zoomtarget = Mathf.Clamp(zoomtarget, minzoom, maxzoom);
    _camera.orthographicSize = Mathf.SmoothDamp(_camera.orthographicSize, zoomtarget, ref velocity, smoothtime);
}

}

kindred lintel
#

Is a first person view achievable with cinemachine 3?

kindred lintel
#

Nvm. Figured how to do that

frank escarp
#

update: I rewrote my entire script and completely deleted cinemachine from my game.

#

it now works as i want it to. 🙂

worldly plover
#

Question about zooming: I'm causing my camera to zoom in out by manipulating the CameraDistance value of the position composer. However, if my camera is "homing in" on another target (this is kind of an RTS-like camera) and at the same time I zoom, the camera will zig-zag. It will zoom in in the current forward direction and then move laterally.

What would be the best way to make it zoom along the direction it is heading?

royal tartan
worldly plover
royal tartan
#

Well I'm not sure why your zoom is happening in fits and starts like that

#

that could be an issue with your code? Are you changing the distance over time manually?

worldly plover
#

that's just me pressing the mousewheel different times 🙂

royal tartan
#

tbh I would probably disable manual zooming (and do an automatic zoom) when selecting a planet like that

worldly plover
#

and how can you do that?

Right now I was zooming like this:
ActiveControl.Distance = Mathf.SmoothDamp(ActiveControl.Distance, targetCameraZoom, ref cameraZoomDampVelocity, CameraSettings.ZoomSmoothTime, 100, Time.deltaTime);

#

activecontro.distance is an interface to the position composer

royal tartan
#

just disable whatever code you have doing that during the transition^

#

like if (!currentlyTransitioningToNewTarget) DoZoomLogic();

worldly plover
#

That's a solution I guess, but people might still try to press the mousewheel and then it won't work.

royal tartan
#

Is that an issue?

#

The point was that the zoom makes the camera transition look bad

#

Is it that essential that zooming works during the transition?

#

again I would likely do an automatic zoom as part of this transition

worldly plover
#

to some extent, right now if you zoom in enough the system goes to a different "mode", where the planet is seen "in scale" with the correct proportion (so it would hide very far away planets and show moons, etc.)

Since the "homing in" part takes at least a second I thought people would attempt to zoom in anyway, so I wanted to make it more pleasant.

tiny lion
#

I added shoulder switching to my project with 2 Third Person Follow cameras. Should I delete one and just make the shoulder switching function move the Camera Side from 1 to 0?

#

I kinda got hit with this realization now but do I HAVE to do it? Will there be issues if I just keep the 1 camera on each shoulder method?

tiny lion
#

Damn son 😔

royal tartan
tiny lion
#

Oh ok

#

I won't have to recode

#

Also can you tell me why the Third Person sample scene is using this setup?

#

Isn't there an extension for the Third Person Follow camera that does Aiming?

royal tartan
#

no idea

tiny lion
#

Ok then

#

My main question was about the shoulder switching and that has been answered

#

Thanks

tiny lion
#

Yeah with this setup I'm pretty much ending with 4 cameras per player (2 for Third Person Shoulders, 2 for Aiming)

#

Will this have any impact to performance? I'm new to this

#

And again, it's PER player, so in the end it's gonna be like 40 cameras

royal tartan
#

cinemachine is designed to have lots of inactive CinemachineCameras

#

it's fine

tiny lion
#

Aha thanks

#

You've put my mind at ease. Thanks for the help

junior hawk
#

Hello, please help! How do I make the third-person camera rotate around the character instead of around its axis? I want to get the effect where the character goes one way and the camera can look the other way. I'm using Unity 6.3.

quaint nimbus
#

anyone getting these errors when upgrading from 2.x to 3.x?

quaint nimbus
#

i cant even access any of the api's in the script

royal tartan
echo wren
#

im watching a tutorial, does anyone know where these axis controls are now in the latest version of cinemachine? first pic is from the tutorial im watching

echo wren
late basin
late basin
echo wren
late basin
quaint nimbus
storm patio
#

how do drive Cinemachine cameras with custom input now? I've looked at the InputAxisController docs and samples but they don't really appear to work.

royal tartan
storm patio
# royal tartan which components did you pair it with

I was trying to use this sample https://github.com/Unity-Technologies/com.unity.cinemachine/blob/main/com.unity.cinemachine/Samples~/Input System Samples/Split Screen Multiplayer/CustomInputHandler.cs
When I add it to my camera the property panel shows a bunch of "No GUI implemented" errors

GitHub

Smart camera tools for passionate creators. Contribute to Unity-Technologies/com.unity.cinemachine development by creating an account on GitHub.

royal tartan
#

and how did you install cinemachine

storm patio
royal tartan
#

having just installed the cinemachine package

#

dumb question but do you have the input system package installed?

storm patio
#

which version? I'm using 3.1.2

royal tartan
#

3.1.5

#

Unity 6000.3.4f1

storm patio
#

I'll try the newest version of the package

#

nope same problem, I'm on Unity 6000.3.5f2 and 3.1.5 of Cinemachine

#

I'll try a fresh project

#

works in a fresh project so it has to be some package interferring

#

Is it possible to set the horizontal/vertical axis on the CinemachineOrbitalFollow without using an CinemachineInputAxisController?

stiff void
#

can anyone help me with the pixel perfect camera, i want to increase what the player can be see while keeping pixel perfect. My problem is my player view is either too small or too large

ivory wraith
#

the pixel-perfect camera makes each asset pixel take up a whole number of pixels on your screen

ivory wraith
#

you can't make each asset pixel take up 1.5 pixels on screen or you'll get tons of flickering

#

since some pixels will wind up larger than others

#

pixel art requires careful thought about how large your assets are

humble hamlet
#

is there a way to make my target group cinemachine not zoom THAT far in

#

found it in the aim settings

storm patio
#

with CinemachineOrbitalFollowis there a reason why the center of an axis is not always the exact midpoint between the range? When I check the recentering button the center will update with a new value which is the correct orientation behind the character.

royal tartan
#

or change the Group Framing size

storm patio
#

I'm using a tracked target, I can see in the source code that CinemachineOrbitalFollow recalculates the horizontalaxis center based on the forward of the target. Is there a way to trigger an instant calculate + recenter from code? I don't want it to lerp

#

from what I can see UpdateHorizontalCenter is an internal method and is only called in this case

      if (HorizontalAxis.Recentering.Enabled)
          UpdateHorizontalCenter(orient);
solid harness
#

On the old cinemachineFreeLook component, there was a "Follow" and a "Look At" parameter. now, there is only the "Tracking Target". How can I change the "Look At" parameter on the new Cinemachine Camera component

errant shard
astral otter
#

Hi. I've been trying to create a zone that when the player enters, it shakes the camera until the player leaves the area. I have a zone now with a noisesetting but the tremor happens only when the player enters the zone and not continuously. Is there a way to do it through cinemachine itself? maybe with its own script?

royal tartan
#

Do the actual shaking in Update or a coroutine

mellow plover
#

how do you access the tracking target field via code?

#

oh that's really confusing

mild eagle
#

Hello team!

#

I am using Cinemachine (XDDDDDDD)
it is a top down camera

and also Confiner 3D for it

#

it is, like I said a TOP DOWN game, the blue squares are the Confiner 3D

#

[THIS IS THE IMPORTANT PART]
The confiner is working nicely, however my rotation composer, rotates in both Axis, X and also Y

#

Only want my camera to rotate in Y```
#

instead, I would like this as the result.

Camera only rotating up and down...

(Achieved by disabling, Rotation Composer)

#

I have two solutions in mind.

Having many cameras and toggling them when needed, that way I can control if a camera has rotation composer and many other things.

Or two, having a rotation composer that only goes up and down. <= It is what I would like best

mild eagle
#

for example, in this case, Cinemachine Rotation Composer
or it could be Cinemachine Follow

#

I cannot just do CinemachineCamera.TargetOffset.

I am NOT looking for the CINEMACHINE CAMERA, when looking for those values in script.

I am looking for the specific component that holds those values.

#

For example this case:

#
CinemachineCamera and CinemachineFollow

are both the same camera object, but since I am looking for the values in CinemachineFollow,
I need a reference to that component```
#

Because CinemachineCamera is one component, CinemachineFollow is another component, they are working together, but they are not the same.

#
public void SwitchCameraPerspective(PerspectiveDirection perspective)
{
    Vector3 perspectiveOffset = Vector3.zero;
    _topDownCameraFollow.FollowOffset = perspectiveOffset;
}```

Here is for example, how I am needing to change values in the Cinemachine Follow.

I need a reference directly to that component, and not just the CinemachineCamera. Even though, both components are in the same object, they are not the same.
#

maybe mucho texto, but I hope it helps

royal tartan
mild eagle
#

🤔 okay, that could work

royal tartan
#

You could actually just use the built in PositionConstaint component for it

#

instead of setting as a child

#

and just disable the y axis

mild eagle
#

okay, this is not 100% clear for me

#

but I am streaming, if you have a moment!

royal tartan
#
  1. Make an empty object
  2. Attach the PositionConstraint component to it.
  3. Set the player object as the only source object in the sources list
  4. Freeze only the Y position axis (uncheck the other two)
  5. Click the Zero button, then Activate button
  6. Set the empty object as your cinemachine target
#

(ignore the settings i have there)

mild eagle
#

beautiful thank you, trying it out now!

#

I don't think it is working,

#

If you have a second, I am sharing my screen on stream!
I think assistance can be much better in real time

royal tartan
#

you could show screenshots of what you tried

mild eagle
#

a position constraint

#

is is constraining, the position of the camera

#

I want to constrain the rotation

royal tartan
mild eagle
#

it was its own root object

#

no parent

#

new empty game object

royal tartan
#

right - and then how did you set up the cinemachine camera?

mild eagle
#

I reversed it

royal tartan
#

If it's on its own object it will not do anything to the camera itself

royal tartan
mild eagle
#

I did it, but I took it back to what I had before. Becausse it was not working

#

but all I did was to change the tracking target

#

to that Position Constrain

royal tartan
#

Yeah that's all you needed to do

mild eagle
#

and it was constraining my position, only Y was moving

royal tartan
#

that doesn't make sense 🤔

mild eagle
#

what?

#

a position constrain

#

to constrain the position?

#

:VVVVVVVVVVV

royal tartan
#

The position constraint constrains the position of the object it's on

#

no other objects

mild eagle
#

yes

#

and my camera is following it

royal tartan
mild eagle
#

but it has X and Z frozen

royal tartan
#

it should have y frozen not x and z

mild eagle
#

rotation, not position

#

is what I need to freeze

royal tartan
#

I am aware of that

mild eagle
#

streaming, sharing screen better

#

if not, it's okay I'll try things on my own

royal tartan
#

By freezing the Y position of the object your camera is LOOKING at

mild eagle
#

communication and time will be not good here

royal tartan
#

the camera will never need to tilt up or down

mild eagle
#

I have another solution in mind now tho

#

so it's fine

#

I will remove the rotation composer, and do whatever I need via script

#

or, if there is a Rotation Composer, that only rotates up and down please let me know

wintry sable
#

whenevre i add cinemachine cam, the character rotates crzily

#

crazily

#

as if the cam has influence in physics

mystic yoke
wintry sable
mystic yoke
#

dont do that, it should be its own seperate object with cinemachine

wintry sable
#

like that?

mystic yoke
#

yes

wintry sable
#

oh well

#

i gotta find a tutorial that works with cam and player being siblings

mystic yoke
#

set the tracking target in the camera to the player and it will still follow it

wintry sable
#

probably becz root is on ground

#

and idk how to remove these blue lines with the yellow square

#

do i have to make a separate LookAt block?

mystic yoke
#

set position control to follow and then in the component that appears below you can set the follow offset

#

the yellow square is just the follow damping

mystic yoke
wintry sable
mystic yoke
#

Can you show the full components?

wintry sable
mystic yoke
#

play with the offset while you are ingame, it should update live

wintry sable
#

this is a better img for the 3rd img

wintry sable
#

btw the cam rotates following my mouse

#

how to disable cursor tracking

mystic yoke
#

the last component you have is an input axis controller

#

it does exactly that

wintry sable
#

oh ill remove it

mystic yoke
#

wait ill check my project that has a similar setup to yours

wintry sable
#

alright

mystic yoke
#

this is my current setup

#

the Target Offset down in the rotation composer sets where you look at

wintry sable
#

hmm ill try

mystic yoke
#

Btw you can turn off the lines and the yellow thing by switching the "Game View Guides" in the main component

#

Ping me if you need further help, otherwise I might not notice followup messages 😄

wintry sable
solid harness
#

if i wanted a script to disable all cinemachine mouse movement, how would i do that? is there a better way then disabling/enabling the input axis controller component

royal tartan
short frost
#

To anyone who has played arma 2 or similar, how does one achieve a view/headbob like in arma 2? I cant seem to be able to deconstruct exactly each individual movement of the camera in this

#

Assuming this can be done with cinemachine btw, i think the noiseprofile might play a big role but im unsure

short frost
#

ok i made something that seems similar, movement on x and y axis and some tilting on the z axis

solid harness
#

is it possible to change the spline shape on the Cinemachine Orbital Follow component?

#

this curved U shape

#

i know there is a slider to change how curved the line is but it doesnt change the overall shape of the spline

#

also are there any games that use the three ring type of camera?

#

i cant think of any games using it

agile blaze
#

Hello, when i am working with cinemachine i am getting something wrong it pissed me off, like when using the third person aim camera it's just not rotating and i am trying to add pan tilt it just rotates around it self and not like beside the player so it will get that aiming style.
Any idea?

timid vortex
#

is there a way to get this camera style?

#

also how do i turn it on/off in the editor i know wahts causing this but i dont know wehre unity has the button for it

agile blaze
timid vortex
#

waht is lso

agile blaze
#

click this to disable this camera style

short frost
#

Isometric ^

short frost
royal tartan
slim atlas
#

Would anyone be willing to help me figure out my third person camera? i went through multiple different tutorials and i cant get the mouse to control rotation

royal tartan
slim atlas
#

okay

#

Something about my look orbit input is off making the mouse not rotate the camera

royal tartan
slim atlas
#

ohhh my god

#

i enabled it and it didnt change anything. that wouldve been embarrassing if that were it

royal tartan
slim atlas
#

my free look camera is targetted to an empty object within my player called CameraTarget that is positioned in my characters head and i have not put any other components on the free look camera

royal tartan
#

It's obviously not just a Cinemachine Input Axis Controller

slim atlas
royal tartan
royal tartan
# slim atlas

can you show how the rotation composer is set up here?

slim atlas
slim atlas
royal tartan
# slim atlas

wouldn't you not have a rotation composer for a free look?

#

the rotation composer forces it to look at the tracking target, doesn't it?

#

or... hm maybe i'm slightly confused. Is it the Free Look modifier that is supposeds to handle this?

#

The Look orbit X and Look Orbit Y - are those coming from the Free Look modifier, or where

#

Oh wait it's the Orbital Follow

#

I forgot - yeah it's not really the rotation that's the issue it's the orbital follow position

slim atlas
royal tartan
#

no i think it's actually useful/needed - but seeing the orbital follow might help. not sure

slim atlas
slim atlas
slim atlas
#

is this relevant?

#

its a component under my player

slim atlas
royal tartan
royal tartan
#

those are the axes that the input is driving. They come from the orbital follow component:

slim atlas
royal tartan
#

I'm not sure either unfortunately.

slim atlas
#

would my cursor not locking in the game tab be a reason?

#

it doesnt do it automatically, I had to make a script to do that

royal tartan
#

it technically shouldn't matter... and yeah you always would have to do that in your own script

slim atlas
#

alright

royal tartan
#

if you try binding this to a different input does it work then?

#

like try making an action with jeyboard inputs and see if you can get that working

slim atlas
#

and placing that in these?

royal tartan
#

yes

slim atlas
#

actually not very interesting

#

at first i thought it didnt move the camera but the values were still moving but it was actually moving the camera, just very slowly

royal tartan
#

ok maybe that same thing is happening for the mouse

royal tartan
slim atlas
#

if there are, its not explicitly called sensitivity but here it is expanded

#

im assuming it might be input value?

slim atlas
#

oh ok

royal tartan
#

If you turn that way up what happens

#

make it like 10

#

or 100

#

Do you have a very high dpi mouse

slim atlas
slim atlas
slim atlas
slim atlas
#

This is what I see that is typically used for mouse input

royal tartan
#

This is your problem

#

You're using a control scheme and you haven't added this binding to it

slim atlas
royal tartan
#

TBH I would recommend just deleting all of your control schemes unless you're doing local multiplayer

royal tartan
# slim atlas really?

The purpose of contorl schemes are to allow the input system to group the input devices into usable sets of devices to be assigned to different players

#

if you don't have multiple players locally, it's kinda pointless

slim atlas
royal tartan
#

control schemes

slim atlas
#

how do i get rid of it?

royal tartan
#

In the top left of your actions asset there's a control schemes dropdown

#

use the delete control scheme button after selecting the one you want to delete

royal tartan
#

don't you have the one called "New Control Scheme"

slim atlas
royal tartan
#

Seemed like you did from your earlier screenshot

slim atlas
#

if I do, nothing else used it like my WASD and space

royal tartan
#

what shows up when you open that dropdown?

slim atlas
#

but also, making my mouse input under the scheme did not allow it to move the camera

slim atlas
royal tartan
#

yes

slim atlas
#

oh i get it now

#

the name of the scheme confused me

royal tartan
#

indeed

slim atlas
#

i thought it was an option for making one

slim atlas
#

I dont know if im missing anything, but it does not

royal tartan
#

i should think it would work yeah

#

try the "Save asset" button if you haven't already

slim atlas
#

i have

slim atlas
royal tartan
#

can you try this

slim atlas
#

i didnt think it was a sensitivity issue because the values didnt move even a little bit

royal tartan
#

wait nvm - you said it worked with the 2D vector action with the keyboard right?

royal tartan
slim atlas
royal tartan
#

I would try the input debugger

#

make sure the mouse input is actually being read properly

slim atlas
#

found it

#

how do i use it?

#

device is disabled?

slim atlas
#

i enabled it and it doesnt seem to be redisabling

royal tartan
#

so is it working now

slim atlas
#

no

slim atlas
#

i switched back to keyboard inputs to see it work again and forgot to switch back

#

thank you for your help!

agile blaze
#

Hello, when i am working with cinemachine i am getting something wrong it pissed me off, like when using the third person aim camera it's just not rotating and i am trying to add pan tilt it just rotates around it self and not like beside the player so it will get that aiming style.
Any idea?

solid harness
glacial kelp
#

how do I get the padding to be smaller on the confiner?

inland venture
#

hi, can anyone help me? I wanne make a 3d game with a 2d game style like signalis but the camera keeps being weird when it is colliding with my pro builder objects or any objects at all, the box is just the player: I am using a virtual camera that cannot be rotated, and i am also using a collider

#

yes its supose to be pixelated

#

i want it so the place will just become black

royal tartan
#

a video might help, as well as an explanation of how the scene is set up, how your camera is set up, and what the desired camera behavior is

inland venture
#

instead of wobbely lines it shoulkd have just been a black sky just like in signalis

royal tartan
#

well that part has nothing to do with cinemachine

#

that's just your actual unity camera settings

#

check the Background type under Environment

#

set it to Solid COlor instead of Uninitialized

inland venture
#

sure i try

inland venture
royal tartan
#

ok you seem to be using built in render pipeline instead of URP

#

but yeah your Clear Flags being Solid Color is correct

#

check what they are set to while the game is playing

#

maybe something is changing it

#

perhaps the CM camera (i forget if it has those settings)

inland venture
#

hmm i found the problem i think

#

so i am using for the pixelated look a render texture

#

but its interfering with the camera in the wrong way and that is making those weird lines

#

the settings for that is this:

royal tartan
inland venture
royal tartan
#

that doesn't explain how you're drawing the texture on the screen

#

presumably you're using a RawImage component in a canvas

inland venture
#

oohhh ofc, sorry i aint very good with unity yet so i dont always know what you mean, but yea i am using a raw image

royal tartan
#

righ tso... show how your canvas is laid out

#

probably you can fix this by adding a black image underneath the rawimage

inland venture
#

damn

#

it worked :D

#

tysm!

thick stone
#

I don't know if this question is best suited for the Cinemachine channel, but I'm using a cinemachine camera, so I hope it's fine.
I'm working on the player menu/inventory and I'm zooming the camera in right over the player's shoulder.
How I'm doing this rn is by disabling the Cinemachine camera component and moving the actual camera, then when the player leaves the inventory, it turns the component back on. This makes it snap back to the last position, which just looks bad, is there a way I can get it to move back smoothly?

errant shard
thick stone
errant shard
inland venture
#

my room just feels so flat, and not of the fact that there is nothing there yet, its just the perspective of what i want feels wrong. Is it because of the map or because i have forgotten something with cinemachine.

royal tartan
#

notice that you can see the side walls on both sides of the room (and that little inset at the top), despite the fact that the props mostly seem to be 2d sprites

inland venture
#

mmmm i can try to make it work with persepctive to see if it will work

royal tartan
#

it's some odd mix of perspective, 2d sprites, and a 3D environment from what I can tell

#

hard to say exactly what they're doing here from this one image

inland venture
royal tartan
#

to make it more orthographic-like

inland venture
inland venture
#

do you know if unity provides a system that makes the camera follow the player only when they are out of view? Kinda like what happends in this game aswell, i am trying to make my own game with this style

https://www.youtube.com/watch?v=FxCvnuWNbgg&t=2479s

A classic survival horror experience set in a dystopian future where humanity has uncovered a dark secret. Unravel a cosmic mystery, escape terrifying creatures, and scavenge an off-world government facility as Elster, a technician Replika searching for her lost dreams.

For NSFW Content: Patreon: https://www.patreon.com/TheBaldMan

If you enjoy...

▶ Play video
royal tartan
#

or with clearshot and multiple cameras. depending on what you're looking for

inland venture
gaunt basalt
#

Is there any way to lock camera rotation ?

royal tartan
errant shard
#

Could blend to another CM camera which doesn't have rotation
I think there's an option for the destination CM camera to inherit the source CM camera's rotation/position, but I don't recall what it was called

pearl plume
#

how to correctly setup cinemachine pixelperfect to smoothly move

errant shard
#

This problem is even worse when the camera is following a sprite that's also snapping to the pixel grid, but with a slightly different timing

pearl plume
#

Somehow fixed, but character sprite, when moving vertically jitters

sweet cipher
#

When using the character controller for a player, is it ideal to even use cinemachine since you're making a camera controller regardless

royal tartan
sweet cipher
royal tartan
#

Where did you get that idea

#

they have nothing to do with each other

sweet cipher
#

Oh ok

royal tartan
#

Sounds like maybe you 're not actually asking about CharacterController. You're asking about first person shooter style games. CharacterController is not limited to FPS games.

As to the question about cinemachine - even if you are 100% coding your camera yourself, I believe it's still worthwhile to use CInemachine in every game because it gives you access to the benefits of using multiple cinemachine cameras, blending between them, etc.

sweet cipher
royal tartan
#

Yeah that sounds like a misconception you picked up somewhere

brisk sage
#

How do I use cinemachine to make a screen shake effect that shakes the camera in random directions?

errant shard
brisk sage
errant shard
brisk sage
errant shard
# brisk sage Well, I can set an initial force and time for the shake, but how do I set the no...

Noise profiles are used to apply noise to CM cameras
Impulse Sources instead have a Shape that defines how the impact jolts the camera
Impulse Listeners additionally can use a noise profile to mix in noise with the received impulses
You can either blend in to and out of a CM camera that has noise when you need shaking, or do a similar thing with impulses
It's depends on how you want to introduce the shaking at runtime
Impulses can guarantee the motion starts sharply, but noise alone is easier to make continuous

brisk sage
errant shard
brisk sage
errant shard
lethal sable
#

I'm quite new to cinemachine and currently I'm trying to make a first person cutscene for a school project.

I'm trying to animate the character running however, the cameras that I'm using keep forcing a slow in/slow out effect and it's adding an ugly stutter to my animation (I'm sure any experts or even intermediates here know what I mean).

Currently I'm just using static cameras, but I'm wondering what would be a good alternative to making a first person running scene.

Would a cinemachine cam following a spline work better? Are there any alternatives that have been used?

I've been looking around on forums, yt, reddit, stack overflow, etc to find a solution but haven't come across a definitive one yet.

The video is what I've got right now.

lethal sable
#

honestly. Should I only be using one camera and animating the character? I feel like that would be a much more effective system

ivory wraith
#

Praetor's suggestion is the way to go

lethal sable
#

Yeah, I was just being stupid, instead of using cams Ive just been animating the model and getting it to move while making the cam follow a specific bone on the model.

Thanks either way!

wary topaz
#

using cinemachine for the first time and was wondering, is there a way i can make it so the free look camera only moves when the player left click and drags instead of anytime the mouse moves?

royal tartan
wary topaz
late basin
solar stream
#

so in my game, I have a freelook camera (orbital follow), and a scoped in camera (third person follow), that the player can toggle by scoping in.
for some reason, when transitioning back to the freelook camera ('scoping out'), the camera 'rubberbands' back and forth a bit, but interestingly only when the player is moving towards the camera.
(.gif attached. in this example the transition is set to 1 seconds so the 'rubberbanding' can be seen more clearly, but normally it is only visible for a few frames).

the scoped in camera (third person follow) is driven by its tracking target, which effectively copies the rotation of the freelook camera (which is drive by the player's inputs). this is to ensure the two cameras have the exact same position when scoping in and out.

in the inspector I can see that it is the gameObject that is the scoped in camera's tracking target that's wiggling around. but I'm not sure why, since it simply calculates its own rotation based on the horizontal and vertical axes of the freelook camera:

void Update()
    {
        float yaw = Cam_Freelook.HorizontalAxis.Value;
        float pitch = Cam_Freelook.VerticalAxis.Value + PitchOffset;

        transform.rotation = Quaternion.AngleAxis(yaw, Vector3.up) * Quaternion.AngleAxis(pitch, Vector3.right);
    }

but the axes of the freelook camera do not change during the rubberbanding, which is very strange, as it means that the update code above should produce the same rotations (which as we can see is not the case: the tracking target wobbles around). I've tried ensuring the script executes after all cinemachine scripts, using LateUpdate() etc but this still happens. this must mean that something else is modifying the rotation of the tracking target, (does cinemachine modify the position of a camera's tracking target somehow?)

#

if I debug.log the transform.rotation of the tracking target inside Update(), and then debug.log it again inside LateUpdate(), it is different, showing that another script is clearly modifying it.

errant shard
solar stream
#

no

errant shard
#

Or under anything else that moves or rotates?
I'd also try to eliminate all scripts that could be changing it in Update
Any Animator ever touching the CM camera transforms or transforms or their hierarchy?

solar stream
#

ah, that's it! the tracking target (that the above update loop is on) was a child of the player, and so it was inheriting their rotation as well

#

just have to figure out a way to get the scoped in camera to copy the position of the player again smoothly, since the above script has to execute before cinemachine's scripts to get a smooth rotation (which isn't a suitable time to copy position without jitter)

solar stream
#

managed to get it working using a target group. position is controlled via the group members, then I just added my script to the group object and used manual mode for rotation

brisk sage
#
    {
        Vector2 mouse = input.mouseGamePos;
        aimCursor.rectTransform.position = mouse;
        aimCursor.rectTransform.Rotate(0, 0, Time.deltaTime * rotateAimSpeed);
        eyeball.up = (mouse - (Vector2)transform.position).normalized;
        Vector2 bodyPos = transform.parent.parent.position;
        if (Vector2.Distance(mouse, bodyPos) / 2 < maxAheadDistance) camFollow.position = (bodyPos + mouse) / 2;
        else camFollow.position = bodyPos + (mouse - bodyPos).normalized * maxAheadDistance;
    }``` camFollow is the cinemachine's tracking target. camFollow is a sort of a lookahead for the player so the camera can move in the direction the player is looking at with the mouse. I was wondering if there is a better way of setting camFollow's position, or a different way to achieve this altogether.
royal tartan
#

When you do (mouse - bodyPos) you're subtracting the mouse's screen space position from an object's world space position

#

The correct way would be to get a world space position corresponding to the mouse position first

#

and the way to do that would be with Camera.ScreenPointToRay to create a Ray and then using Plane.Raycast with a Plane constructed to match the 2D game world plane.

elfin helm
#

If you look at the end, around 0.54 I show what the room layout is supposed to look like (Even then, it seems that the cinemachine camera is not following my bounderies, why is it looking past the boundaries i set

royal tartan