Cinemachine Transposer & Composer for Top-Down Object Targeting | Unity Tutorial

Поділитися
Вставка
  • Опубліковано 31 лип 2024
  • Still manually controlling your Camera position & rotation? Consider using Cinemachine to simplify your workflow, get smooth, high quality transitions, all with low effort! Learn about the Transposer and Composer for a top-down style game in this Unity Tutorial.
    I started using Unity long before Cinemachine came out, so I was already used to controlling the Camera via code. Usually I did this in a simplistic fashion, directly tied to a player location with an offset, maybe rotating based on user input, and it worked fine. Recently I ditched my (literally called) SimpleThirdPersonFollow script with Cinemachine and I was really impressed with how much better the game felt! You know we all love that game-feel, so why not use a powerful, free tool that makes that easy?
    In this week's tutorial you'll learn how you can use the Transposer and Composer (and what each configuration option does!) to frame & follow your Player using Cinemachine!
    👨‍💻 As always, the full project code is available on GitHub: github.com/llamacademy/cinema...
    💸 Ongoing sales 💸
    ⚫ See all active asset sales on the Asset Store: assetstore.unity.com/?on_sale...
    ⚫ Save 25% off your first Asset Store Order: prf.hn/click/camref:1101l9QvC...
    ⚫ Save up to 50% on NEW Assets: assetstore.unity.com/?new_sal...
    📚 Resources
    ⚫ Tranposer Binding Modes: docs.unity3d.com/Packages/com...
    ⚫ Transposer: docs.unity3d.com/Packages/com...
    ⚫ Using Cinemachine: docs.unity3d.com/Packages/com...
    ⚫ Composer: docs.unity3d.com/Packages/com...
    ❤ Believe in LlamAcademy's mission and have received value from the videos? Become a Patreon Supporter or UA-cam Member:
    ⚫ Patreon: / llamacademy
    ⚫ UA-cam Member: / @llamacademy or click the Join button on any video
    📱 Let's stay connected
    UA-cam: / llamacademy
    Patreon: / llamacademy
    Facebook: / llamacademyofficial
    Twitter: / thellamacademy
    TikTok: / llamacademy
    Instagram: / llamacademy
    ----
    Most tutorials come from knowledge gained making survival.llama.software Llama Survival - a top-down zombie survival shooter for Android and iOS.
    I also have some Unity Assets (affiliate link): assetstore.unity.com/publishe...
    Some links may be affiliate links, which at no additional cost to you, gives me a small portion of the purchase.
    #unitytutorial #tutorialtuesday #gamedev #tutorial #unity #llamacademy #gamedevelopment
    Chapters:
    00:00 Topic Introduction
    01:30 Cinemachine Fundamentals
    03:33 Set up a Virtual Cameras & Cinemachine Brain
    04:25 Virtual Camera Overview
    06:06 Transposer Binding Modes Overview
    08:50 Transposer Damping
    09:23 Humble Bundle SALE
    10:57 Composer - Damping & Lookahead
    12:34 Composer - Screen, Deadzone, and Soft Zone
    15:25 Closing Thoughts

КОМЕНТАРІ • 22

  • @ASouza-ut9kb
    @ASouza-ut9kb Рік тому +2

    Best video about Unity Cameras

  • @dreamisover9813
    @dreamisover9813 Рік тому +2

    Great! I never worked with CineMachine (and Timeline) properly yet, this gives some good insights on the former

  • @cyco3oy
    @cyco3oy Рік тому +2

    As always on top.

  • @crispy6532
    @crispy6532 Рік тому

    My virtual camera has no effect on the transform of the main camera whenever i use SceneManager.LoadScene to restart play. I then deleted both cameras and remade them, setting Transposer and Composer and now the main camera "jumps" to origin when i hit play. Why does my virtual camera not override my main camera? What am i missing?

  • @nickdevprod3667
    @nickdevprod3667 Рік тому

    hey liam great video. can you tell me why is my object jittering when using cinemachine to follow rigidbody? rigidbody interpolation is turned on . i tried changing settings on cinemachine to fixedupdate and tried different combinations but it was still lagging(more on some cases). im moving object with rb.velocity. also i tried creating empty game object and lerping it towards player and assigned cinemachine follow to that object still same. my script looks something like this. rb.velocity(dir.x * speed, rb.velocity.y, dir.z * speed); is it possible that player is jittering because of this code? thanks

    • @LlamAcademy
      @LlamAcademy  Рік тому

      Do you have a simple project I can check out to see what you mean? A couple immediate ideas are to play with the look ahead time, look ahead smoothing, and possibly the dead zone to smooth it out.

    • @nickdevprod3667
      @nickdevprod3667 Рік тому

      @@LlamAcademy no sadly i dont have project files anymore. It was game jam game made for wowie game jam hosted by jonas tyroler

    • @nickdevprod3667
      @nickdevprod3667 Рік тому +1

      @@LlamAcademy thanks for answering me. You got great channel

  • @creative.outlet
    @creative.outlet 3 місяці тому +1

    Thank you! It really helped simplify things for me :)

  • @Raccoon0710
    @Raccoon0710 Рік тому

    Can you please share your camera setting in your example (wip). Particularly I am interesting in how camera slighly rotates around player, while you moving

    • @LlamAcademy
      @LlamAcademy  Рік тому +1

      Sure! It's really close to what I used here. I have "hard look at" and a transposer with some damping. Here's a screenshot of the exact configuration I have right now. ibb.co/WDWcDm3
      I'm thinking I may make it be a Composer instead of Hard Look at, but I haven't fully decided how I want it to be 😅

  • @angiemon897
    @angiemon897 4 місяці тому

    Great Video! Cinemachine is an awesome package but dealing with it can also be a pain in the ass if you're not sure how to achieve a certain effect, ahhh! 🙈
    (but I'm eternally greatful you can do all this without coding ^^)
    Does anyone know how I could achieve the following:
    The camera is a topdown arena cam and should follow the player and have boundaries (already managed to do that! With a follow target on the player and a cam confiner)
    But for the boss level, the cam should still be centered on the player, but also framing the boss enemy, in the way that the camera distance gets bigger when the boss would leave the cam.
    Anyone has any idea? (:

  • @heman922
    @heman922 Рік тому +2

    Plz do more about job system and physics ❤️❤️❤️

    • @LlamAcademy
      @LlamAcademy  Рік тому

      Any specific areas you’re looking to be covered in physics / job system space?

    • @heman922
      @heman922 Рік тому

      @@LlamAcademy job system rigidbody movement plz ❤️

    • @LlamAcademy
      @LlamAcademy  Рік тому +1

      🤔 I'll see what I can do

  • @Xerceth
    @Xerceth Рік тому

    Kinda unrelated question but what tool did you use to make the level ? Is it Probuilder ?

  • @BrunoBozicB
    @BrunoBozicB Рік тому

    Hello, do you perhaps have any info (perhaps you have done some research for your own purposes) on how to make a good ARPG camera setup for games like Diablo: Immortal and or Warhammer 40k Martyr (action based, click to move, camera follow ARPG)?

    • @LlamAcademy
      @LlamAcademy  Рік тому +1

      Hey Bruno!
      I would imagine that most ARPG camera setups use something like these Composer and Transposers to follow the player. A good starting point may be Transposer with World Space binding mode and some offsets to get the angle you want. Then play with the Composer values to get the feel you're looking for.
      For things like Camera Shake, you can use the Cinemachine Impulse Source to trigger those.
      I am using basically the setup I just described in the (still in-development) Llama Survival 2.0 release to get a really nice feel.

  • @Dippps
    @Dippps Рік тому

    i find it overshoot for most projects. so i never actually used it

    • @LlamAcademy
      @LlamAcademy  Рік тому

      I thought it was too much, but after implementing it I found it to be really useful to make the camera movement feel better