Search Unity

  1. The 2022.1 beta is now available for testing. To find out what's new, have a look at our 2022.1 beta blog post.
    Dismiss Notice

Bug CameraStateDriven Animations doesnt play in WebGL build

Discussion in 'Cinemachine' started by Octarina, Mar 18, 2021.

  1. Octarina

    Octarina

    Joined:
    Oct 4, 2019
    Posts:
    8
    Hi,

    I found nothing on the forum about this issue thus i'm reporting it here.

    When i play an animation from an animator binded to a CinemachineStateDrivenCamera to make trasition between cameras, everything works fine in editor and when i build in Mono. But nothing append when i build for WebGL.
    The web browser console doesn't display anything.

    The bug seems to be appeared after Unity 2020.1.x

    The correct behavior works with: Unity 2020.1.x and with Cinemachine 2.6.x or 2.7.x
    No animations are launch with: Unity 2020.2.x, 2020.3.x and with Cinemachine 2.6.x or 2.7.x

    Dev environment: windows 10 x64

    Some screenshots to reproduce:

    upload_2021-3-18_13-59-7.png
    upload_2021-3-18_14-0-9.png

    Clicking on the buttons will change the camera. Everything works fine in editor, but not in WebGL after building with Unity version above 2020.1.x

    Best regards
     

    Attached Files:

    Last edited: Mar 18, 2021
  2. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    5,562
    Can you make an experiment to narrow it down? What happens if you remove the buttons and instead make the states just rotate automatically? Do the correct vcams then activate?
     
  3. Octarina

    Octarina

    Joined:
    Oct 4, 2019
    Posts:
    8
    If i do a cycle in the animator (cf screenshot), everything works fine. Camera is transiting between vcam1 and vcam2 indefinitly.

    upload_2021-3-23_14-11-38.png
     
  4. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    5,562
    Good. So then the problem is not with the StateDrivenCamera, it's more likely with the buttons-animator interaction in WebGL. Maybe you can try making a small sample project with some buttons and an animator and see if it works in WebGL.

    You might try asking on the WebGL forum: https://forum.unity.com/forums/webgl.84/
     
  5. Octarina

    Octarina

    Joined:
    Oct 4, 2019
    Posts:
    8
    All the other animations from my projects works fine with the buttons and the animator. Only the Cinemachine siwtching fail.

    I will take a look at the WebGL forum.
     
  6. edoncov2

    edoncov2

    Joined:
    Jul 9, 2021
    Posts:
    2
    Hello
    i have same problem with cinemashine and webGL build.
    did you find the solution?
     
  7. Octarina

    Octarina

    Joined:
    Oct 4, 2019
    Posts:
    8
    I didn't want to spend too much time being sent between all unity team services. Thus i waited until a new unity version patch this issue.
    Problem is gone in Unity v 2021.1.9f1
     
    Last edited: Jul 22, 2021
    Gregoryl likes this.
unityunity