Search Unity

Using Cinemachine for First Person On-rail Camera.

Discussion in 'Cinemachine' started by Mooltee, Mar 16, 2019.

  1. Mooltee

    Mooltee

    Joined:
    Nov 27, 2018
    Posts:
    1
    Hi everyone. I have been creating a first person melee game which basically move the first person camera around the environment and in some points player will have a melee fight with the enemy . Basically what im using is to move playerholder which holds player camera and the hands with ClearShot camera on rails using timeline different sequences. i do this with ClearShot camera because i want the camera be able to go on the rail but i set some child vcams to look at different objects and everytime i want i blend betwen each virtual camera.I did this with ClearShot because i can use clearshot cam animator to move all the vcams and not have to animate all the vcams movements too. So first i want to ask is this the best way to do it? second i have a issue between each timeline blend . basically i add cinemachine dolly track script to each clearshot and set it on different pos and on every timeline i start animating the sequence from there but clearshot cams do not blend between each timeline smoothly and everytime player kill the enemy it has a distinct cut. how can i fix this?

    here is the picture,
    something to keep mind is i havent started using clearshot for first sequence so nvm about that.
    the second cam on rail is the clearshot first position. I would be really grateful if someone help me out

    P.S : is there better way to move couple of vcams under another object which move on dolly rail ? because right now i use the extra dolly cart script and not the actual rail script which have extra settings like damping and all that
    [Imgur](https://i.imgur.com/6Gx4DhB.png)
     
    Last edited: Mar 16, 2019
  2. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,728
    You shouldn't be using a ClearShot for this application. The purpose of the ClearShot is to do automatic subcamera selection based on visibility - which is not at all what you want. You're doing manual selection with the timeline.

    So, replace the ClearShot with an empty GameObject as a container. Attach the Dolly Cart to that, in order to move all the child vcams at once. Once you get rid of the ClearShot, the blends will probably start working the way you want them to.
    The Dolly Cart is the correct way to move a collection of objects along the track. You can either animate its path position directly, or create a custom script to animate it procedurally, with damping and any other features you might need.
     
    Mooltee likes this.