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 Cinemachine yellow dot rest position / offset

Discussion in 'Cinemachine' started by tsunamigue, Aug 31, 2023.

  1. tsunamigue

    tsunamigue

    Joined:
    Feb 17, 2015
    Posts:
    17
    Hello.

    Im having troubles moving the camera as I desire. In a 2D plataformer, the ideal movement that I need is that the dead zone of the vc is larger above the yellow dot and shorter bellow it, so when it jumps or goes up dont move until a certain point, but lowers the camera much sooner when going down.

    Setting the Y Damping to maxium and reducing the death zone to none while using soft zones and Y bias achieved something close but the camera still moves little when going up.

    Any way or fixing the yellow dot rest position closer to one of the death zone walls? in this case the down one. Like in the picture:
    upload_2023-8-31_5-49-31.png
     
  2. antoinecharton

    antoinecharton

    Unity Technologies

    Joined:
    Jul 22, 2020
    Posts:
    156
    Hey :)
    Have you tried playing with BiasY?
     

    Attached Files:

  3. tsunamigue

    tsunamigue

    Joined:
    Feb 17, 2015
    Posts:
    17
    Hello Antoine, thanks for the answer. Im using BiasY too, this is what I had at the point of the post, but doesnt resemble to the image. The camera will still move when going Up because of the soft zone. The main problem is that going up and down ends with different camera view where sometimes I see too much of the ground, thats why I want the yellow dot to rest down inside a dead zone. Can the yellow dot be moved by code?

    upload_2023-8-31_18-16-59.png upload_2023-8-31_18-17-16.png
     
  4. antoinecharton

    antoinecharton

    Unity Technologies

    Joined:
    Jul 22, 2020
    Posts:
    156
    For the ground have you tried the confiner 2D extension? Might be better suited for your use case to constrain the camera.

    For the soft zone the way to reduce it's size is by changing the Dead zone width and height.
     

    Attached Files:

  5. tsunamigue

    tsunamigue

    Joined:
    Feb 17, 2015
    Posts:
    17
    Thanks Antoine.
    The thing about augmenting the dead zone, is that the yellow dot goes into the middle, Im strong in wanting in down there.

    I will check that options.
     
  6. tsunamigue

    tsunamigue

    Joined:
    Feb 17, 2015
    Posts:
    17
    The confiner won't work since I want to go much higher, but when going down end in the exact same position where it was, with cinemachine Im having trouble doing this since I cant set a transform.
     
  7. antoinecharton

    antoinecharton

    Unity Technologies

    Joined:
    Jul 22, 2020
    Posts:
    156
    Hmm maybe I am not understanding what you want. Do you have an example of a game that has a similar camera movement?
     
  8. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,233
    These settings seem to give what you seem to want, out of the box. Am I misunderstanding something?

    jump with dead zone.gif

    upload_2023-9-5_9-33-39.png
     
    Last edited: Sep 5, 2023
    antoinecharton likes this.
  9. tsunamigue

    tsunamigue

    Joined:
    Feb 17, 2015
    Posts:
    17
    That only worked for me because when falling, sets the point in that lower position, but when you start the game, the point is in the center.
     
  10. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,233
    Yes, that's true. If the starting point is the only remaining issue then you can spawn the vcam with a zero-size dead zone and composer's Screen Y set to put the yellow dot at the right place on the screen, then change the settings on the next frame.
     
  11. tsunamigue

    tsunamigue

    Joined:
    Feb 17, 2015
    Posts:
    17
    I'll try doing that, thanks. This is done in code right?
     
  12. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,233
    Yes
     
    tsunamigue likes this.