Search Unity

  1. Unity 2018.1 has arrived! Read about it here
    Dismiss Notice
  2. Scriptable Render Pipeline improvements, Texture Mipmap Streaming, and more! Check out what we have in store for you in the 2018.2 Beta.
    Dismiss Notice
  3. If you couldn't join the live stream, take a peek at what you missed.
    Dismiss Notice
  4. Improve your Unity skills with a certified instructor in a private, interactive classroom. Learn more.
    Dismiss Notice
  5. ARCore is out of developer preview! Read about it here.
    Dismiss Notice
  6. Magic Leap’s Lumin SDK Technical Preview for Unity lets you get started creating content for Magic Leap One™. Find more information on our blog!
    Dismiss Notice
  7. Want to see the most recent patch releases? Take a peek at the patch release page.
    Dismiss Notice

New Cinemachine v1.5

Discussion in 'Cinemachine' started by Adam_Myhill, Mar 5, 2017.

  1. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    1,212
    You don't need to hack the Brain code for this. Using the CinemachineExtension API, it's very simple to add an extension to the vcam that post-processes the position prior to it being passed to the Camera.
     
  2. treecki

    treecki

    Joined:
    Feb 6, 2017
    Posts:
    7
    Ahh ok that's great to hear! I definitely feel janky hacking into the brain code. How exactly would I go about doing this with the CinemachineExtension API then? Would I make a new script that grabs the cinemachine brain and tells it's position? Because I want the z order change to apply for all vcams, not just a follow cam for the character. Also is this z order formula the best method for top down z order 2d cameras?
     
  3. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    1,212
    Here is a simple script that uses the CinemachineExtension API to lock the camera Z. Add it as an extension to each of your virtual cameras (it will show up in the "extensions" menu at the bottom of the vcam inspector. From script, just add it as a component).
    Code (CSharp):
    1. using UnityEngine;
    2. using Cinemachine;
    3.  
    4. /// <summary>
    5. /// An add-on module for Cinemachine Virtual Camera that locks the camera's Z co-ordinate
    6. /// </summary>
    7. [ExecuteInEditMode] [SaveDuringPlay] [AddComponentMenu("")] // Hide in menu
    8. public class LockCameraZ : CinemachineExtension
    9. {
    10.     [Tooltip("Lock the camera's Z position to this value")]
    11.     public float m_ZPosition = 10;
    12.  
    13.     protected override void PostPipelineStageCallback(
    14.         CinemachineVirtualCameraBase vcam,
    15.         CinemachineCore.Stage stage, ref CameraState state, float deltaTime)
    16.     {
    17.         if (stage == CinemachineCore.Stage.Body)
    18.         {
    19.             var pos = state.RawPosition;
    20.             pos.z = m_ZPosition;
    21.             state.RawPosition = pos;
    22.         }
    23.     }
    24. }
    Sorry but I don't really understand this question. It's not clear to me exactly what you're trying to do.
     
    Alverik likes this.
  4. XN4k3dBR

    XN4k3dBR

    Joined:
    Sep 15, 2015
    Posts:
    11
    I have version 2.110, but dont work xbox one !
    I managed to compile for xbox one but the scenes created by the cinemachine 2.110 do not work!

    why?
     
    Last edited: Jun 1, 2018
  5. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    1,212
    Can you be a little more specific?
     
  6. XN4k3dBR

    XN4k3dBR

    Joined:
    Sep 15, 2015
    Posts:
    11
    The cutscene works in unity normally, but when I send to xbox one it does not work.
     
  7. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    1,212
    "Does not work" isn't specific enough.
     
  8. XN4k3dBR

    XN4k3dBR

    Joined:
    Sep 15, 2015
    Posts:
    11
    Okay. I have an intro cutscene. In unity it works perfectly, but when I send to xbox one the cutscene gets stopped, do not run.
    it doesnt even start running, stays in he first frame
     
    Last edited: Jun 1, 2018
  9. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    1,212
    Why do you think this is a Cinemachine problem?
     
  10. XN4k3dBR

    XN4k3dBR

    Joined:
    Sep 15, 2015
    Posts:
    11
    because he game was running ok before i put that cutscene on
     
  11. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    1,212
    ok, but maybe it's a timeline thing, not a Cinemachine thing. You say the timeline stays on Frame 1. You might try asking on the TImeline forum. Try simplifying your cutscene to search for the culprit.
     
  12. XN4k3dBR

    XN4k3dBR

    Joined:
    Sep 15, 2015
    Posts:
    11
    I solved the problem. Updated Unity's version and it worked
    thx for supporting
     
  13. ramJat

    ramJat

    Joined:
    Jun 12, 2018
    Posts:
    9
    Hello,
    i am getting some errors when i try to make build for Holocene(UWP).

    C:\Users\RChoudharyX098698\AppData\Local\Unity\cache\packages\packages.unity.com\com.unity.postprocessing@2.0.3-preview\PostProcessing\Runtime\PostProcessManager.cs(77,41): error CS1061: 'Type' does not contain a definition for 'IsAbstract' and no extension method 'IsAbstract' accepting a first argument of type 'Type' could be found (are you missing a using directive or an assembly reference?)

    C:\Users\RChoudharyX098698\AppData\Local\Unity\cache\packages\packages.unity.com\com.unity.postprocessing@2.0.3-preview\PostProcessing\Runtime\PostProcessManager.cs(76,40): error CS1061: 'Type' does not contain a definition for 'IsDefined' and no extension method 'IsDefined' accepting a first argument of type 'Type' could be found (are you missing a using directive or an assembly reference?)

    C:\Users\RChoudharyX098698\AppData\Local\Unity\cache\packages\packages.unity.com\com.unity.postprocessing@2.0.3-preview\PostProcessing\Runtime\PostProcessManager.cs(75,40): error CS1061: 'Type' does not contain a definition for 'IsSubclassOf' and no extension method 'IsSubclassOf' accepting a first argument of type 'Type' could be found (are you missing a using directive or an assembly reference?)

    i am try to make build for UWP using unity version 2018.1.1 with LightWeight pipeline
     
  14. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    1,212
    PostProcessing v2 isn't compatible with UWP/Mono due to the fact that it's a very limited runtime that doesn't even support the base .Net API, it only works with UWP/IL2CPP
     
  15. ramJat

    ramJat

    Joined:
    Jun 12, 2018
    Posts:
    9
    Does it solved in new unity version 2018.2
     
  16. ramJat

    ramJat

    Joined:
    Jun 12, 2018
    Posts:
    9
    Whenever i import holotoolkit in project it shows this error
    System.Exception: Package directory not found: "C:\Users\RChoudharyX098698\.nuget\packages\Microsoft.CSharp\4.0.1".
    at UnityEditor.Scripting.Compilers.NuGetPackageResolver.Resolve () [0x000dd] .

    Why, any suggestions
     
  17. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    1,212
    We generally recommend users to move to UWP/IL2CPP as it's better in every way.
     
  18. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    1,212
    Try positing this question on another thread, maybe the package manager one
     
  19. ramJat

    ramJat

    Joined:
    Jun 12, 2018
    Posts:
    9
    But After selecting IL2CPP another error coming.
    Unsafe code may only appear if compiling with /unsafe. Enable "Allow 'unsafe' code" in the inspector for 'Packages/com.unity.render-pipelines.core/CoreRP/com.unity.render-pipelines.core.Runtime.asmdef' to fix this error.
    i am already allow 'unsafe' code active but still facing this issue.
    please help me i am facing this issue since long time.
    thanks
     
  20. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    1,212
    I can't really help you on that one. Try asking the question here: https://forum.unity.com/forums/editor-general-support.10/
     
  21. ramJat

    ramJat

    Joined:
    Jun 12, 2018
    Posts:
    9