Search Unity

Blending from a virtual camera controlled by player to a dolly path camera issues

Discussion in 'Cinemachine' started by FALLENxGaLaXie5, Oct 30, 2017.

  1. FALLENxGaLaXie5

    FALLENxGaLaXie5

    Joined:
    Dec 15, 2015
    Posts:
    10
    So I have 2 separate issues here.

    First, I'm running a virtual camera on my player character that is controlled by a script. The lookAt and follow components aren't assigned as I really like the behavior my movement script yields. This worked great in 2017.1, but I just updated to 2017.2 and the camera movement script just completely stopped working. I realize I could use the free look cameras; I haven't looked a ton into this because I thought I could just reuse the old camera script.

    Second, I'm trying to blend to a timeline that has a dolly path that has the path position animated over timeline. When I run this playable director in the editor, it works great. When I add my event that ups the priority of the vcams involved in this dolly path and then play the timeline, it will usually switch to the first vcam in that timeline sequence when it's supposed to, but just not play the timeline; the camera just sits there. I am using the gameobject.GetComponent<PlayableDirector>().Play() to run the timeline and then just upping the priorities for those vcams over my player's control vcam to do this. Where am I going wrong?

    Play on awake is set to false... that's the only other thing I could think of atm.
     
  2. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,730
    Why would upgrading to 2017.2 break your movement script? Are you dependent on some old API?
    There is no obvious reason why you shouldn't be able to control the vcam's transform with your script.
    What version of Cinemachine are you using?

    You don't need to up the priority. Cinemachine tracks in the timeline always trump the priority system. You just have to run the timeline. When the timeline ends, the priority system resumes control.

    As for why the timeline isn't playing, I would ask that question on the Timeline forum. https://forum.unity.com/forums/timeline.127/
     
  3. FALLENxGaLaXie5

    FALLENxGaLaXie5

    Joined:
    Dec 15, 2015
    Posts:
    10
    Ah I didn't know the timeline track trumps the priority system. I've tried taking out the priority changes and just playing the timeline; it does the same thing, it just switches to the first dolly track camera on the timeline but doesn't play it. So this leads me to believe it's somehow switching to the first camera on the timeline but not playing the timeline, so I'll look into that.


    As for my camera movement code, I don't believe it's dependent on any old APIs, although I am relatively new so I could be wrong. I uploaded it if you want to take a look.

    Thanks!
     

    Attached Files:

  4. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,730
    Camera code looks fine. It should work. Can you show me a picture of the inspector for the vcam where this script stopped working?
    What version of Cinemachine are you using?
     
  5. FALLENxGaLaXie5

    FALLENxGaLaXie5

    Joined:
    Dec 15, 2015
    Posts:
    10
    upload_2017-10-30_14-48-55.png



    I'm using cinemachine 2.0.
     

    Attached Files:

  6. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,730
  7. FALLENxGaLaXie5

    FALLENxGaLaXie5

    Joined:
    Dec 15, 2015
    Posts:
    10
    upload_2017-10-30_15-10-25.png


    Still not working, although the new release looks like it has some great improvements.

    It was working without any changes before I updated to 2017.2 from 2017.1, so that's all I can think of that's causing this.
     
  8. FALLENxGaLaXie5

    FALLENxGaLaXie5

    Joined:
    Dec 15, 2015
    Posts:
    10
    Apologies I just got it working; I shouldn't have all those variables exposed, somewhere in the process they got changed and it screwed it up somehow.

    Any suggestions on getting the playable director to play? I posted in timeline but no one has responded yet.

    Thank you so much for your help!
     
  9. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,730
    Can you show me a picture of your timeline?
     
  10. FALLENxGaLaXie5

    FALLENxGaLaXie5

    Joined:
    Dec 15, 2015
    Posts:
    10
    upload_2017-10-30_15-57-32.png

    I also haven't been able to find anything on blending from a virtual camera that's not part of a camera to a timeline. I'm sure there's an easy way to do this, but so far all I've been able to do is set up blends within timeline and also the custom blends from any 2 cameras via the cinemachine brain.
     
  11. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,730
    I think you're asking about blending between a timeline vcam and a non-timeline vcam?

    What you do is to click on the CM vcam clip at the start (or end) of your track in the timeline. In In the inspector, in the section above the vcam stuff, you'll see some general clip options relating to blending the clip in/out. If you set those, the clip will blend in/out from nothing - which in this case means whatever vcam is currently selected by the priority system, i.e. the current game camera.

    Just poke them on the timeline forum about starting/stopping the timeline from script. They'll answer you eventually :)
     
  12. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,730
    Just noticed in your image that the Timeline Trigger script has "None" in the Timeline Playable field. Could that be it?
     
  13. FALLENxGaLaXie5

    FALLENxGaLaXie5

    Joined:
    Dec 15, 2015
    Posts:
    10
    I actually changed the script so it has a function that I call from another script that played the timeline, and it worked. I'm not sure exactly why that was worked differently, but the timeline plays great now so I'm not complaining!

    And it blends from other cameras beautifully now too, thank you so much!