Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Question Shifting Camera/Sideways movement in First Person

Discussion in 'Cinemachine' started by snan, Aug 30, 2023.

  1. snan

    snan

    Joined:
    Aug 11, 2015
    Posts:
    9
    Hi,

    i hope someone here can help me out.

    I'm super new to using Cinemachine, but i've set it up with deadzones and it slightly moves the First Person Camera sideways and i'm trying to mitigate that. Something is held in hand, and in Player view, but the Camera shifts slighlty sideways when moving around.

    It's at 99% of the Behaviour that i want, which is follow the Handheld Object, but from a fixed POV, i mean you don't sway your head left and right, when looking at an Object :rolleyes:

    It should follow the Object until the deadzone threshold and then move the Camera, only when it goes out of those Bounds.

    Do i need a different Cinemachine Component?

    I've tried different distances from the camera, but couldn't get it to work.

    The Cube kinda moves around the Camera, instead of straight to it?

    How could i change it up, so that slight shifting movement goes away.
     
    Last edited: Sep 2, 2023
  2. antoinecharton

    antoinecharton

    Unity Technologies

    Joined:
    Jul 22, 2020
    Posts:
    156
    Heyyo :) ,
    As a first troubleshooting step to make sure nothing is interfering with your camera transform can you put your VCam in the root of the project? What happens when you do that?
     

    Attached Files:

  3. snan

    snan

    Joined:
    Aug 11, 2015
    Posts:
    9
    Hey!
    Thanks for the advice, i've tried it with a completely new Project and the First Person Starter, and there it does work, without the shifting issue.

    So the Problem is with my Player Character (and it's Camera transform). It breaks in my Project, when i move the Camera outside of the Hierarchy, since i'm using Adventure Creator from the Assetstore.
    Since it relies on the Hierarchy, i'd have to figure out to take the Camera outside of it, or make it work somehow :-(

    Would it be possible to make it work with my Player Controller, or does it have to be outside of the Hierarchy?
    I don't quite understand why it moves around something, i'm using a Character Controller for movement.
     
  4. antoinecharton

    antoinecharton

    Unity Technologies

    Joined:
    Jul 22, 2020
    Posts:
    156
    You could definitely make it work parenting the camera. It's something we don't necessarily recommend because it's harder to troubleshoot issues.

    To solve your problem try to assign FirstPersonPlayer gameobject to the follow field of your camera. This way it will ignore what the parent does.

    Let us know if it works for you :)
     
  5. snan

    snan

    Joined:
    Aug 11, 2015
    Posts:
    9
    Unfortunately it didn't change for me, i've tried both the parent Objects.

    Something had to change with Assets Camera, got it working! Thank you again for your Time and help and have a good weekend!

    //It had to do with the Parenting of the Camera to the right place, it seems like it moved it's place slightly in-game, so i had to reset it to it's original position with AC.
     
    Last edited: Oct 8, 2023
  6. antoinecharton

    antoinecharton

    Unity Technologies

    Joined:
    Jul 22, 2020
    Posts:
    156
    Awesome let us know :)