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

Cinemachine not work in build

Discussion in 'Cinemachine' started by GiftedMamba, Feb 17, 2022.

  1. GiftedMamba

    GiftedMamba

    Joined:
    Feb 25, 2017
    Posts:
    46
    Hi!
    I'm using Cinemachine with new input system.

    I added CinemachineInputProvider to my vCam and it works fine in editor.
    However, when I build my game, my camera doesn't received any input. I have no errors in console during game and no errors in game log.

    I tried to add some logs to GetAxisValue method, but it seems that this method doesn't called in the build.

    For now I have no idea what I can do to figure out what is going on. Any thoughts?
     
    Last edited: Feb 18, 2022
  2. antoinecharton

    antoinecharton

    Unity Technologies

    Joined:
    Jul 22, 2020
    Posts:
    156
    Hello,

    I tested with 2021.2 Cinemachine 2.8.4 and it's working on build. I am guessing it's specific to a version or a config issue. What version of unity and Cinemachine are you using? Did you change anything on the player settings?

    Let us know :)
     
  3. GiftedMamba

    GiftedMamba

    Joined:
    Feb 25, 2017
    Posts:
    46
    In my current project I'm using Cinemachine 2.6.11, Input System 1.2.0 and Unity 2020.3.26
    Yesterday I tried to make a copy of my project and build it in Unity 2021.2.11 with Input System 1.3.0 and Cinemachine 2.8.4. The result was the same - everything works in editor, but not in build.

    In my project settings I'm using IL2CPP, .NET 4.x and new Input System as a default input system.
     
    Last edited: Feb 18, 2022
  4. GiftedMamba

    GiftedMamba

    Joined:
    Feb 25, 2017
    Posts:
    46
    Well, I figured out what was wrong.
    I have two virtual cameras in my project, one is dynamic, and one is static. But I forgot to change priority at startup and they have same priority. And as I understand, Cinemachine randomly choose between those virtual cameras. In editor it choose my dynamic camera, but in build it choose my static camera.

    That was the reason of "bug".
     
    Last edited: Feb 18, 2022
    antoinecharton likes this.