Unity Playables is Actually a Game-Changer

Поділитися
Вставка
  • Опубліковано 1 сер 2024
  • The Playables API holds hidden potential that can transform your game development. In this video, you'll learn how to add runtime animations to your characters that come from objects that provide their own animations, automating complex sequences and creating more dynamic environments with minimal coding. Join us to unlock the secrets of these powerful tools and elevate your game's animation system to the next level!
    Links: docs.unity3d.com/6000.0/Docum...
    docs.unity3d.com/6000.0/Docum...
    Want to support me? 😀
    Buy me a coffee! ko-fi.com/adammyhre
    🔔 Subscribe for more Unity Tutorials / @git-amend
    Discord: / discord
    #unity3d #gamedev #indiedev
    ▬ Contents of this video ▬▬▬▬▬▬▬▬▬▬
    0:00 Playables API
    1:05 Playable Graph Setup
    5:00 Locomotion Mixer
    6:26 Dynamic Animations
    12:25 Doing More
    Source code: gist.github.com/adammyhre/f06...
    More Useful Code:
    github.com/adammyhre?tab=repo...
    Unity Utility Library: github.com/adammyhre/Unity-Utils
    Lock Inspector Hotkey: gist.github.com/adammyhre/475...
    Assets Shown In This Video (Affiliate Links)
    More Effective Coroutines: assetstore.unity.com/packages...
    Modular 3D Text: assetstore.unity.com/packages...
    Gridbox Prototype Materials FREE: assetstore.unity.com/packages...
    RamsterZ Loot Anims: assetstore.unity.com/packages...
    Kawaii Animations: assetstore.unity.com/packages...
    Clazy Runner Action Animations: assetstore.unity.com/packages...
    Synty Prototype: assetstore.unity.com/packages...
    Hierarchy Icons: assetstore.unity.com/packages...
    Better Transform: assetstore.unity.com/packages...
    Better Mesh Filter: assetstore.unity.com/packages...
    Kyeoms VFX: assetstore.unity.com/publishe...
    Follow me!
    linktr.ee/gitamend
  • Ігри

КОМЕНТАРІ • 139

  • @git-amend
    @git-amend  26 днів тому +28

    Happy Sunday! Hope you all like this dive into the Unity Playables API, let me know in the comments if we should do a deeper dive into a more complex use case!

    • @Krechevskoy
      @Krechevskoy 26 днів тому +4

      I would love to see a deep dive on this. In particular it would be cool to see how to use this to use for something like a multi part interaction, like climbing a ladder (i.e. Dark souls), or a multi-actor interaction, like a finishing move (i.e. God of War) or a backstab.

    • @yonatanabergel
      @yonatanabergel 26 днів тому

      Would love! Unity 6 is very promising so far :)

    • @git-amend
      @git-amend  26 днів тому +2

      All good ideas, I'm taking notes!

    • @ggwp8618
      @ggwp8618 26 днів тому

      Hi. How about covering the topics of Photon Multiplyers?

    • @git-amend
      @git-amend  25 днів тому +1

      @@ggwp8618 I've thought about that, but I'm not sure how well that would go over. But, I have been looking at the new Photon products lately, so it is in the back of my mind.

  • @SunSailor
    @SunSailor 26 днів тому +30

    Please continue on this topic, as Timeline is nothing else than a playable graph as well. It is an essential system for Unity and frustrating few coders know about it, not speaking about being proficient in it. We had to cut an awful lot of detail features, because people in my team even didn't understand what I tried to tell them about this system, so your videos would be essential resources, not only for me, but for the whole development scene. Thank you for the already made videos!

    • @git-amend
      @git-amend  26 днів тому +8

      Sounds good, taking notes for a follow up. I’d like to talk about Timeline a bit more as well. Cheers!

  • @ImmortalTimothyM
    @ImmortalTimothyM 26 днів тому +13

    Wow, 1 minute into the video and just showing that More Effective Coroutines exists is worth watching this. Thanks.
    I have been looking into using the Playables system for interacting and emotes for a game so this is great timing.

    • @git-amend
      @git-amend  26 днів тому +1

      Glad it was helpful!

  • @Assassin1923
    @Assassin1923 26 днів тому +10

    Hi! Your channel is a real find! I am a unity developer and I find your content very useful. Thank you!

    • @git-amend
      @git-amend  26 днів тому +1

      Happy to hear that! Thank you!!

  • @MrOmega-cz9yo
    @MrOmega-cz9yo 24 дні тому +4

    Hi! I was unaware of both Playables, and the More Effective Coroutines asset. Thanks for the info!

  • @Fitz0fury
    @Fitz0fury 26 днів тому +15

    I had never even heard of this. another great video!

    • @git-amend
      @git-amend  26 днів тому

      Haha, I thought you might like this one! Cheers!

  • @adek445
    @adek445 26 днів тому +2

    It's so cool! I would love to get into more complicated system that you've mentioned. I wish you will come up with some nice video that moves this to the next level one day.
    Much love!

    • @git-amend
      @git-amend  26 днів тому +1

      Thank you... I think there likely will be a follow up vid to this with something more complex, look for that in a few weeks!

  • @GameDragon2k
    @GameDragon2k 26 днів тому +3

    This video came at a great time. As I was just exploring the Playables API.

  • @darkenaxe
    @darkenaxe 26 днів тому +2

    I didn't know about this API, thank you for this quick and efficient presentation!

  • @friedcrumpets
    @friedcrumpets 16 днів тому

    I looked into this a few months ago and found barely any resources on it. It would be absolutely incredible if you could cover this in-depth. Such an incredible tool that doesn't get enough attention.

    • @git-amend
      @git-amend  16 днів тому +1

      So far just one follow up vid, hasn't gotten much attention though. Perhaps down the road we can build something more involved though. It's definitely very useful.

    • @friedcrumpets
      @friedcrumpets 16 днів тому

      @@git-amend I'll drop it a watch and I'll keep my eyes for some more Playables content in the future. Keep up the great work 👍
      I noticed you were using IEnumerators in this too. Have you had a look at Awaitables yet? Or UniTask for pre Unity 2023. I've hopped off coroutines since I discovered these.

  • @alif-fgd
    @alif-fgd 25 днів тому +3

    Great content as always! I had never heard of this API, looks powerful.
    Just some personal feedback in this particular video, with just your introduction I struggled to find the main objetive of the system or what pain a system like that could alleviate. I needed to see the end of the video to understand better what exactly you were trying to achieve. Might be just me, but anyway, I thought it could be usefull to share

    • @git-amend
      @git-amend  24 дні тому +1

      Thanks for the comment, I'll keep your feedback in mind.

  • @ChristopherYabsley
    @ChristopherYabsley 19 днів тому

    This is such professional content. Amazing work and thanks for sharing the knowledge.

  • @derbabonennt8876
    @derbabonennt8876 26 днів тому +3

    Although i knew the playable api this video was very informing.
    Could you make a video about the script-playables - these are the type of playables where I dont know how or for what to use them.

    • @git-amend
      @git-amend  26 днів тому +1

      Yeah, I think we’ll have to have a follow up video to this one with a more advanced use case.

  • @soheil4471
    @soheil4471 24 дні тому

    This was a great video
    you've got yourself a new subscriber :)

  • @NongBenz
    @NongBenz 25 днів тому +1

    Surprised I haven't heard about the Playables API. Sounds like the smart objects in FEAR where the animations and data are stored in the world objects instead of on the player directly.

    • @git-amend
      @git-amend  25 днів тому

      Hm yeah, they must have done something similar!

  • @pickgliss2498
    @pickgliss2498 25 днів тому +2

    The unity team must hire you!!! you can make the unity must better!!!!!!

  • @Sosa829
    @Sosa829 20 днів тому

    That's so cool, I seriously need a video explaining how to expand this into a full animation system with way more Animations/blend trees and Masks. how to add events at certain frames etc

    • @git-amend
      @git-amend  20 днів тому

      Another great idea for a video, cheers!

  • @yonatanabergel
    @yonatanabergel 26 днів тому +1

    This + Interactable system.
    Insane :)

    • @git-amend
      @git-amend  26 днів тому

      Haha that's for sure!

  • @Broudy001
    @Broudy001 26 днів тому +1

    Hot Damn that is wicked, I definitely need more of this.

    • @git-amend
      @git-amend  25 днів тому

      Great, glad to hear that. I think I'll do one or two more on this topic in a little while.

    • @Broudy001
      @Broudy001 23 дні тому

      @@git-amend I love to see / use this to do a combat system where the animations swap in and out based on the weaponry equipped or the position in a combo

    • @git-amend
      @git-amend  21 день тому

      That's a good idea, I'll jot that down

  • @Shonnyy
    @Shonnyy 26 днів тому +2

    Awesome vid! What's the drawing tool you're using to draw the playable graph diagram?

    • @git-amend
      @git-amend  26 днів тому +3

      Thank you! The tool is called Excalidraw, you can use it online or integrate it with Obsidian: ua-cam.com/video/o0exK-xFP3k/v-deo.html

  • @castlecodersltd
    @castlecodersltd 23 дні тому

    Interesting, thanks for sharing 🙂

  • @RafaelAzriaiev-kv9qm
    @RafaelAzriaiev-kv9qm 26 днів тому +1

    Very informative video.
    Small question would you use playable like delivering clip when changing equipment to use the animation of that specific weapon or would you use something else?

    • @git-amend
      @git-amend  26 днів тому

      You certainly could do that, and in fact that might be optimal.

  • @damonfedorick
    @damonfedorick 26 днів тому +2

    Nice!

  • @lucianobisconti9078
    @lucianobisconti9078 25 днів тому

    Excelente video y la manera en la que explicas, se aprende mucho y se aprecia.

  • @filipadamczuk99
    @filipadamczuk99 26 днів тому +2

    Great video! I would love to see an episode about async vs coroutines in Unity. With the addition of the Awaitable class in the latest Unity versions, it seems that using coroutines is becoming obsolete. Focusing entirely on the async workflow appears to be more efficient. The ability to easily switch between threads with Awaitable is particularly impressive:
    ```csharp
    // Execute something on the main thread
    await Awaitable.BackgroundThreadAsync();
    // Now execute something on the background thread
    await Awaitable.MainThreadAsync();
    // And back to the main thread
    ```
    I think this approach is fantastic!

    • @git-amend
      @git-amend  26 днів тому +1

      Great idea, I’ll add that to the list!

  • @RoxGame
    @RoxGame 26 днів тому +1

    I've always found the Playables API confusing, but your explanations make everything clear. Thank you! I'm wondering: what's the best approach to sync this system over a network?

    • @git-amend
      @git-amend  26 днів тому +1

      Thanks for the comment... as for syncing over a network, that's a big discussion, but I would do my utmost to only sync the events happening and not the result of those events. And it really also depends on what package you are using - for the most part, Unity can handle syncing things that are done via the Animator, which is the case here (note that we passed the animator in when creating the PlayableGraph - the Animator is doing the animating and can be synced with a NetworkAnimator component for example if you were using Unity's NGO).

    • @RoxGame
      @RoxGame 26 днів тому

      ​@@git-amend I believe Mirror and NGO only sync animator parameters, which i believe not available in the Playables system. However, I'll give them a try. Thank you so much!

  • @MrTomateSalat
    @MrTomateSalat 26 днів тому +4

    I only can recommend Playables to everyone because the Unity animator is really a terrible thing to deal with. The good thing is that it doesn't have to be an either or. In my last project I've created PlayableGraphs on the fly and let them take control over the animator. So for basic locomotion stuff I use Animator (as long as it isn't complex animator is good enough) but for more advanced stuff I go for Playables.

    • @git-amend
      @git-amend  26 днів тому +1

      I like this approach. I would opt for this as well, a combination of both is really the best way to go in most cases.

  • @tommelling9847
    @tommelling9847 25 днів тому +2

    Amazing stuff! Didn't even know this existed, would have been incredibly useful on out last project.
    Also the way you deliver higher level concepts is amazing, talking through each part without making assumptions and 'skipping' ahead. You have a rare talent for teaching. Keep up the good work.

    • @git-amend
      @git-amend  25 днів тому

      Glad to hear that! Thank you!

  • @AryanSingh-cw6ce
    @AryanSingh-cw6ce 26 днів тому +1

    Very helpful video , I always learn something new by these ,If its not too much to ask can you tell me how to create a modular quest system , which can have conditions like how to start , connected with overall world variables (like if a very important event happened in game) than quest become unavailable or can no longer be continued, how to handle saving all the quest points of different types of quest, branching in quests.
    Also on side note: how does elden ring handle their quest allocation.

    • @git-amend
      @git-amend  26 днів тому +2

      Thanks for the comment. That's an interesting topic for a video, I'll write that down! I'm not totally sure about Elden Ring (I haven't played it yet - shocking I know - but I'll find out).

  • @Krechevskoy
    @Krechevskoy 26 днів тому +1

    This is awesome 😎

    • @git-amend
      @git-amend  26 днів тому

      Glad you liked that! Cheers!

  • @littleowlgaming-unity-tutorial
    @littleowlgaming-unity-tutorial 26 днів тому +1

    just out of curiosity, you get the better courotines and all, because it allows to run a coroutine in classes that normally can't. what about async functions? that's what I use in like say scriptable objs that cant use coroutines. and you can run a async just like a coroutine and have return types

    • @git-amend
      @git-amend  26 днів тому

      Another viewer made a similar comment. I've added a coroutines vs async/await discussion video to my TODO list.

  • @PsychoNMG
    @PsychoNMG 26 днів тому +3

    Very cool video! I didn't even know "playables" existed. Certainly something I will be looking into.
    As a "code review", I'm curious if there was a reason you didn't choose to create an enum or a well named constant for the mixer inputs. Is it just because there are only 2 at the time of this video? Probably a bit of a fanatic's /zealot's mindset but I'm triggered when I see magic numbers / strings.

    • @git-amend
      @git-amend  26 днів тому +2

      Thank you! And you are 100% correct, I am also not a fan of the magic numbers and should have changed them - and certainly I would have as soon as the system adds any additional complexity.

    • @midniteoilsoftware
      @midniteoilsoftware 26 днів тому

      You beat me to it ;)

  • @TrentSterling
    @TrentSterling 3 години тому

    Oh boy, this is a rich repository of resources and crazy useful unity magic instantly. Insta-sub!

  • @furkanunlu2177
    @furkanunlu2177 26 днів тому +2

    Each video feels like a lesson. Thanks a lot!

    • @git-amend
      @git-amend  26 днів тому +1

      Glad you like them!

  • @hiperfx892
    @hiperfx892 26 днів тому +1

    More devlogs please

    • @git-amend
      @git-amend  26 днів тому

      Lots more videos on the way.

  • @raymk
    @raymk 20 днів тому

    I've been wanting to make a custom Playable script for custom Timeline tracks, but it's pretty hard to understand.
    I hope one day you will touch on that!

    • @git-amend
      @git-amend  20 днів тому +1

      Next Sunday's video will be about slightly more complex Playables, and while not specific to Timeline it will explain a few of the more complicated things you need for custom Track scripts, such as ExposedReference

  • @Rigdereine
    @Rigdereine 26 днів тому

    I never new about Playables and now it will be my main research target.
    Do you prefer Coroutines over Async? I always prefer the UniTask Library and use them instead of couroutines but its actually just a personal preference and I would like to see a video about when to use what.

    • @git-amend
      @git-amend  26 днів тому

      Sounds good - the Unity docs are a great place to start, and the dig into the forums a bit for more in-depth discussions. I'll probably have another video on this topic as well. As for coroutines vs async, several other commenters today have brought that up so I'll schedule a video for that topic coming soon!

  • @FudgelGames
    @FudgelGames 24 дні тому

    Terrific as usual! Your videos always seem to pop up at exactly the right time for me. The only part that left me a little confused is the blend duration calculation. Wouldn't Mathf.Min(clip.Length * 0.1f, clip.Length / 2) always return clip.Length * 0.1f since 10% will always be less than 50%?
    Would it possibly make more sense to calculate the duration as follows?
    Mathf.Clamp(clip.Length * 0.1f, 0.1f, clip.Length * 0.5f)?
    Or am I just really confused 😅?
    /edit - I guess I really am confused! Clamping doesn't make sense here since again, 10% of clip length will never be greater than 50% of clip length 🤦‍♂

    • @git-amend
      @git-amend  24 дні тому +1

      Thanks for your kind words! You’re right about the logic. Mathf.Min(clip.length * 0.1f, clip.length / 2) will indeed always return clip.length * 0.1f because 10% is always less than 50%. Using Mathf.Clamp(clip.length * 0.1f, 0.1f, clip.length * 0.5f) is a better approach as it ensures the blend duration is not less than 0.1f and not more than half the clip length. Great catch!

  • @bazzboyy976
    @bazzboyy976 25 днів тому

    Awesome video. It's hard for me to see how to see what benefits this solution has over the animator system though. Being able to drive everything explicitly from code is nice though.

    • @git-amend
      @git-amend  25 днів тому

      The main benefit shown in this video is that objects can provide their own animations. You can read about some of the other advantages here: docs.unity3d.com/Manual/Playables.html

  • @launemax
    @launemax 25 днів тому

    Tiny Bug in your code: in the BlendOut Function, the handle variable should be "blendOutHandle". @10:58

    • @git-amend
      @git-amend  25 днів тому +1

      Good eye! I've updated the gist. Thanks.

  • @garryguan7115
    @garryguan7115 26 днів тому +1

    What setting in Rider are you using for AI code gen?

    • @git-amend
      @git-amend  26 днів тому

      I don't think there is any AI Code suggestions used in this video, but in other videos I typically use GitHub Copilot, though I have the JetBrains AI as well which is better suited for other tasks such as refactoring. (in my opinion)

  • @erikafurudo9960
    @erikafurudo9960 25 днів тому

    Is this a new API? Since which version? I didn't know this API existed; it seems really useful.

    • @git-amend
      @git-amend  25 днів тому

      Playables has been around a long time, but for some reason it's never been promoted much by Unity. For example, Timeline, which is an big part of Unity, is based on Playable Graph.

  • @user-fm9wx4wc8h
    @user-fm9wx4wc8h 25 днів тому

    You are the Gem for the Unity Devs!
    can you share any of your game.

    • @git-amend
      @git-amend  25 днів тому +1

      Thank you... and probably one day I'll do a few dev logs, but might not be for a while.

  • @z-time3291
    @z-time3291 26 днів тому

    FUEGO BEBE OTRO TUTO

    • @git-amend
      @git-amend  26 днів тому +1

      Thanks for watching!

  • @AirburstStudios
    @AirburstStudios 26 днів тому +24

    Finally a Programming-Centric UA-camr for Unity. I always thought it's all about people using assets from the store rather than being real developers first

    • @git-amend
      @git-amend  26 днів тому +2

      Thanks! Glad you’re here!

    • @1ulicaaNerd
      @1ulicaaNerd 23 дні тому +1

      I heard that he's an ex-worker for unity

  • @abclef
    @abclef 22 дні тому

    I used this API a few years ago, easy yet powerful, and people can build their customized Animator/Timeline on top of that, which is a must-have for some ACT/Rogue-like games. But the PlayableGraph Visualizer package is still in a very early stage and has been dead for years as its contributor has left Unity, making the whole thing unusable for small studios/ individuals.

    • @git-amend
      @git-amend  22 дні тому

      It's unfortunate that the Visualizer was DOA, but to be honest I found it clunky and unnecessary.

  • @martinvanstein.youtube
    @martinvanstein.youtube 26 днів тому +1

    Great content gave you some coffee money and hope you'll do a full course ... purely for selfish reasons as I am rewriting my first game (and only game for now, called king of crokinole) to be more performant and it is hard to find actual quality content on more advanced topics.
    Any way keep up the good work !!!

    • @git-amend
      @git-amend  26 днів тому +3

      Hey thank you so much! I appreciate the support and the awesome comment!

  • @TheReverseSide21
    @TheReverseSide21 6 днів тому

    What was the software used for making those diagrams?

    • @git-amend
      @git-amend  6 днів тому

      It's called Excalidraw

  • @horusvengador8829
    @horusvengador8829 9 днів тому

    Cual es la pagina donde hiciste esos diagramas para explicar mejor? 👀

    • @git-amend
      @git-amend  9 днів тому

      Excalidraw: ua-cam.com/video/o0exK-xFP3k/v-deo.html

  • @ceeayestro
    @ceeayestro 26 днів тому +1

    I might sound stupid but at what point did you assign the animations to the objects. Thats the only part that has me lost.

    • @git-amend
      @git-amend  26 днів тому +1

      On the Interactable object there is a SerializedField for a clip, which I populated off camera.

    • @ceeayestro
      @ceeayestro 26 днів тому +1

      @@git-amend Copy. I thought i had missed something. Your videos are a ton of help.

  • @landosilva
    @landosilva 25 днів тому

    Hey, awesome content man! Really liking what you are doing here.
    As a follow up, I would love to see a video about Timelines and ExposedReference
    Cheers!

    • @git-amend
      @git-amend  25 днів тому +1

      Great suggestion! I've started taking some notes for a future vid!

  • @user-rm2pj9jf8s
    @user-rm2pj9jf8s 26 днів тому

    WOW

    • @git-amend
      @git-amend  26 днів тому +1

      Thanks for watching, hope it’s useful to you!

    • @user-rm2pj9jf8s
      @user-rm2pj9jf8s 26 днів тому +1

      @@git-amend always useful

  • @fleity
    @fleity 26 днів тому

    Playables are super mighty but the api is so little documented and not particularly transparent. Have fun blending entire time lines :-/
    (plus playable visualizer should be mentioned here)

    • @git-amend
      @git-amend  26 днів тому

      Personally I find the visualizer clunky, but I suppose it’s better than nothing. Too bad it’s not being developed.

  • @ggwp8618
    @ggwp8618 26 днів тому

    Whenever i come to your channel i feel like i dont know shit about unity😅😅😅

    • @git-amend
      @git-amend  26 днів тому

      Always good to fill in the gaps!

  • @martin-schoen
    @martin-schoen 20 днів тому

    This is a great video, not only because it is the 69th :)

    • @git-amend
      @git-amend  20 днів тому +1

      I hadn't even noticed that lol

  • @nehal_chandra2777
    @nehal_chandra2777 26 днів тому

    W

  • @midniteoilsoftware
    @midniteoilsoftware 26 днів тому

    I'm triggered by your use of "magic numbers" for the indexes (e.g. 0 for idle, 1 for walk) - :)

    • @git-amend
      @git-amend  26 днів тому +1

      Yeah, in hindsight I should have taken the time to remedy that. Most certainly if the system were to grow any larger!

  • @Haddleton
    @Haddleton 21 день тому

    Curious why you’re using coroutines with a custom asset instead of just using the new-ish async await support?
    EDIT: sleep-deprived brain did not see the other similar comments lol, but I’ll leave it here anyway. Async await is awesome, coroutines are so annoying lol. Glad they’re on the way out.

    • @git-amend
      @git-amend  21 день тому

      Since this weekend is a follow-up, and there were lots of comments about using async instead, I'll show how to quickly adapt this to use Awaitable as an alternative.

  • @reggieisnotadog4841
    @reggieisnotadog4841 25 днів тому

    This just seems like a much worse version of Animancer. I know this is free but it's just making my investment in Animancer feel very worthwhile. Thanks for the detailed video on it!

    • @nicolasgerard2476
      @nicolasgerard2476 25 днів тому +1

      Well animancer uses that API under the hood ;p Would be a shame if you could slap something like animance in a 10 minute video with explainations on top.

  • @FiazItik
    @FiazItik 7 днів тому

    Hi, what is the texture name that you are using in the plane? @git--amend

    • @git-amend
      @git-amend  7 днів тому

      That's a free asset called Gridbox Prototype Materials - link in the description.

    • @FiazItik
      @FiazItik 7 днів тому

      @@git-amend thanks a lot.