Search Unity

Camera help

Discussion in 'Cinemachine' started by sergeantpocoyo, Jul 29, 2019.

  1. sergeantpocoyo

    sergeantpocoyo

    Joined:
    Feb 19, 2019
    Posts:
    9



    So the above video is the camera I'm hoping to implement on in my current game. You can scrub forward to the 10:00 min mark to see gameplay. Basically they use the same camera movement I'm trying to achieve.

    As you see in the video below the main issue I'm having is with the vertical camera movement. The player character is rather short as he's an octopus. When we aim all the way up the spline changes from moving vertically on a straight line to curved at the end. Vice versa when aiming down all the way. Is there anyway we can get that angle without the spline changing so drastically.

    Another question is if there is a way to keep a more uniform sensitivity? We have the collider on our player camera which collides with the floor. The problem is that it changes the sensitivity to much making aiming very difficult.
     
  2. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,719
    How do you have your orbits set? Can you show an image of the scene view where this is visible?
     
  3. sergeantpocoyo

    sergeantpocoyo

    Joined:
    Feb 19, 2019
    Posts:
    9
    Theres my orbits along with all 3 rigs
     

    Attached Files:

  4. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,719
    So, from the orbits, you are creating a surface that is very curved at the top and bottom. Try increasing the radius of the top and bottom orbits from 1 to something closer to 8. If you set all 3 orbits to 8, for example, then you will get a cylinder.
     
  5. sergeantpocoyo

    sergeantpocoyo

    Joined:
    Feb 19, 2019
    Posts:
    9
    That does smooth it out a bit. But the main problem is that it limits our ability to aim up and down a lot. I should of explained earlier but the game uses a lot of versatility as you will be jetpacking around the level. It's why the orbits were at 1 originally.
     
  6. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,719
    So you want to be able to aim the camera without changing its position? If so, then maybe an orbit camera isn't the way to go, or you need to orbit and aim independently.

    Perhaps you should spec out more precisely exactly how you want the camera to behave, and we can work from there to figure out how to achieve it. I did not notice in your video anything other than pure orbiting.
     
  7. sergeantpocoyo

    sergeantpocoyo

    Joined:
    Feb 19, 2019
    Posts:
    9
    Yeah main thing we are trying to achieve isn't so much how the camera moves on the spline itself. It's having the camera move low or high enough at the angles we want without it affecting the spline.
     
  8. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,719
    So then you don't want what's in the video, because in it the player stays pretty much in the same screen spot, and that means if you want to look up or down it's by orbiting (i.e. changing camera position on the spline). You seem to want something different. Try to describe what you want.
     
  9. sergeantpocoyo

    sergeantpocoyo

    Joined:
    Feb 19, 2019
    Posts:
    9
    So for now the main thing we want to eliminate is what happens to the camera spline when you look all the way straight up. In the video of the octopus above at the 0:09 mark it's almost like the camera follows smoothly moving up, but when it reaches the apex of the spline it moves right. The exact opposite when you look all the way straight down, it curves off to the left. I linked a simple diagram below kind of describing what I mean.

    We even tried taking the collider off and it still happens regardless if you're on the ground or in the air. If we can remove this problem it would allow aiming at extreme angles feel much smoother, as you won't be fighting the camera left or right depending on if you're looking up or down.

    I hope that makes sense
     

    Attached Files:

  10. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,719
    Ok, I'm beginning to understand a little better what the problem is.

    Can you try an experiment: set the tracked object offset in all 3 rigs to (0, 0, 0) and tell me if you still get the deviation from the spline.
     
  11. sergeantpocoyo

    sergeantpocoyo

    Joined:
    Feb 19, 2019
    Posts:
    9
    Yeah that fixes it. So I guess the question is can we get the character to be fixed on the left side of the screen with the spline moving straight throughout?
     
  12. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,719
    One thing you can try is to always look at and follow the center of your character, and then add the CinemachineCameraOffset extension to shift it at the end. Generally it's a good idea to inform your vcam that the character is your item of interest, rather than cheat it by using an offset.
     
  13. sergeantpocoyo

    sergeantpocoyo

    Joined:
    Feb 19, 2019
    Posts:
    9

    So I tried the cameraoffset and it was making the camera act incredibly funky. So I tried creating a empty gameobject within the player character for the camera to follow. Which will act kind of like an offset. Now in the video above you will see the next problem is that the camera when descening lags behind a lot. And I am unable to look upwards when I'm falling down. Is there a way to make the camera locked to only mouse movement or something like that?
     
  14. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,719
    Your empty game object as offset might be a problem because it's in character-local space and will only be in the right spot when the camera is looking from behind.

    I'm not really understanding what you're saying about the lag. Did you try turning off the damping in the 3 orbital transposers?
     
  15. sergeantpocoyo

    sergeantpocoyo

    Joined:
    Feb 19, 2019
    Posts:
    9
    Yeah so I changed it back to cinemachinecameraoffset. and adjusted the orbital transposer damping and it now works like a charm.

    Thanks for all the help! Really appreciate it!
     
    Gregoryl likes this.