Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Follow Player Problem in Beat 'em up Game

Discussion in 'Cinemachine' started by ookk47oo, Jul 29, 2019.

  1. ookk47oo

    ookk47oo

    Joined:
    Mar 17, 2017
    Posts:
    80
    Hi guys,I'm developing a beat 'em up game like castle crashers. I choose the Cinemachine virtual camera to follow my character and use the Cinemachine Confiner to clamp the camera's move area when there are some enemies coming.
    screen.png
    After I defeat all of the enemies,I Set the Confiner 's Bounding Shape2D to null to unclamp the camera and tell the player to keep moving forward.However,here comes the problem.
    screen3.png
    screen2.png
    The camera's position will be suddenly set to the player's position, while I expect it will stay in place until the player reach the edge of the dead area.
    So how should I set Cinemachine for this situation?
     
    Last edited: Jul 29, 2019
  2. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,658
    Would you be willing to prepare a minimal demo project that shows this problem and upload it here?
     
  3. ookk47oo

    ookk47oo

    Joined:
    Mar 17, 2017
    Posts:
    80
    Sure,here it is.
    UnityVersion : 2018.4.3f
     

    Attached Files:

  4. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,658
    Hey thanks for the upload! Very helpful.
    It's a bug in the Framing Transposer!
    We'll fix it for the next release.

    However, even when the bug is fixed, you won't be able to just set the bounding shape to null without a camera pop in this circumstance. You'll have to create 2 vcams, one with the confiner and one without, and enable the appropriate one (or set the priority). To be clear: if you try that now you'll still get the pop (because of the bug), but with the next release that should work properly.
     
  5. ookk47oo

    ookk47oo

    Joined:
    Mar 17, 2017
    Posts:
    80
    Thanks for the advice:)

    BTW, will this also be fixed in the asset store's Cinemachine package?
     
  6. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,658
    No, we are no longer updating the Asset Store version. Is that the one you're using? Which version of Unity?
     
  7. ookk47oo

    ookk47oo

    Joined:
    Mar 17, 2017
    Posts:
    80
    Yes, my project is on Unity 2017.4.14f.
    For convenience'sake, I usually use the version 2018.4.3f to create rapid prototypes and test new features, just like the mini demo above.
     
  8. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,658
    CM 2.2.9 works with Unity 2017. Just copy it into your assets.
     
  9. ookk47oo

    ookk47oo

    Joined:
    Mar 17, 2017
    Posts:
    80
    That's it.
    Many thanks.:D