Unity Playables is Actually a Game-Changer

Ойындар

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-amend27 күн бұрын

    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 күн бұрын

    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 күн бұрын

    All good ideas, I'm taking notes!

  • @ggwp8618

    @ggwp8618

    26 күн бұрын

    Hi. How about covering the topics of Photon Multiplyers?

  • @git-amend

    @git-amend

    26 күн бұрын

    @@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
    @SunSailor26 күн бұрын

    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 күн бұрын

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

  • @ImmortalTimothyM
    @ImmortalTimothyM27 күн бұрын

    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

    27 күн бұрын

    Glad it was helpful!

  • @Fitz0fury
    @Fitz0fury27 күн бұрын

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

  • @git-amend

    @git-amend

    27 күн бұрын

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

  • @MrOmega-cz9yo
    @MrOmega-cz9yo25 күн бұрын

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

  • @git-amend

    @git-amend

    25 күн бұрын

    No problem!

  • @Assassin1923
    @Assassin192327 күн бұрын

    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

    27 күн бұрын

    Happy to hear that! Thank you!!

  • @adek445
    @adek44526 күн бұрын

    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 күн бұрын

    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
    @GameDragon2k26 күн бұрын

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

  • @git-amend

    @git-amend

    26 күн бұрын

    Hey awesome!

  • @darkenaxe
    @darkenaxe26 күн бұрын

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

  • @git-amend

    @git-amend

    26 күн бұрын

    You’re welcome!

  • @alif-fgd
    @alif-fgd25 күн бұрын

    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

    25 күн бұрын

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

  • @derbabonennt8876
    @derbabonennt887626 күн бұрын

    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 күн бұрын

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

  • @friedcrumpets
    @friedcrumpets17 күн бұрын

    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

    17 күн бұрын

    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.

  • @ChristopherYabsley
    @ChristopherYabsley20 күн бұрын

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

  • @git-amend

    @git-amend

    20 күн бұрын

    Thank you!

  • @soheil4471
    @soheil447124 күн бұрын

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

  • @git-amend

    @git-amend

    24 күн бұрын

    Welcome aboard!

  • @filipadamczuk99
    @filipadamczuk9926 күн бұрын

    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 күн бұрын

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

  • @Sosa829
    @Sosa82921 күн бұрын

    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!

  • @Shonnyy
    @Shonnyy27 күн бұрын

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

  • @git-amend

    @git-amend

    27 күн бұрын

    Thank you! The tool is called Excalidraw, you can use it online or integrate it with Obsidian: kzread.info/dash/bejne/oWSZ2q1mqKm2Y84.html

  • @castlecodersltd
    @castlecodersltd23 күн бұрын

    Interesting, thanks for sharing 🙂

  • @git-amend

    @git-amend

    23 күн бұрын

    Thanks for watching!

  • @RafaelAzriaiev-kv9qm
    @RafaelAzriaiev-kv9qm26 күн бұрын

    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.

  • @NongBenz
    @NongBenz26 күн бұрын

    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

    26 күн бұрын

    Hm yeah, they must have done something similar!

  • @Broudy001
    @Broudy00126 күн бұрын

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

  • @git-amend

    @git-amend

    26 күн бұрын

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

  • @Broudy001

    @Broudy001

    24 күн бұрын

    @@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

  • @pickgliss2498
    @pickgliss249826 күн бұрын

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

  • @git-amend

    @git-amend

    26 күн бұрын

    Thanks!

  • @RoxGame
    @RoxGame26 күн бұрын

    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 күн бұрын

    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!

  • @tommelling9847
    @tommelling984726 күн бұрын

    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

    26 күн бұрын

    Glad to hear that! Thank you!

  • @PsychoNMG
    @PsychoNMG27 күн бұрын

    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

    27 күн бұрын

    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

    27 күн бұрын

    You beat me to it ;)

  • @AryanSingh-cw6ce
    @AryanSingh-cw6ce27 күн бұрын

    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

    27 күн бұрын

    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).

  • @TrentSterling
    @TrentSterling18 сағат бұрын

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

  • @git-amend

    @git-amend

    18 сағат бұрын

    Welcome aboard!

  • @damonfedorick
    @damonfedorick26 күн бұрын

    Nice!

  • @git-amend

    @git-amend

    26 күн бұрын

    Thank you! Cheers!

  • @lucianobisconti9078
    @lucianobisconti907825 күн бұрын

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

  • @git-amend

    @git-amend

    25 күн бұрын

    Thank you!

  • @littleowlgaming-unity-tutorial
    @littleowlgaming-unity-tutorial26 күн бұрын

    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.

  • @Krechevskoy
    @Krechevskoy26 күн бұрын

    This is awesome 😎

  • @git-amend

    @git-amend

    26 күн бұрын

    Glad you liked that! Cheers!

  • @furkanunlu2177
    @furkanunlu217726 күн бұрын

    Each video feels like a lesson. Thanks a lot!

  • @git-amend

    @git-amend

    26 күн бұрын

    Glad you like them!

  • @Rigdereine
    @Rigdereine26 күн бұрын

    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
    @FudgelGames25 күн бұрын

    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 күн бұрын

    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!

  • @yonatanabergel
    @yonatanabergel26 күн бұрын

    This + Interactable system. Insane :)

  • @git-amend

    @git-amend

    26 күн бұрын

    Haha that's for sure!

  • @raymk
    @raymk21 күн бұрын

    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

    21 күн бұрын

    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

  • @MrTomateSalat
    @MrTomateSalat27 күн бұрын

    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

    27 күн бұрын

    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.

  • @hiperfx892
    @hiperfx89226 күн бұрын

    More devlogs please

  • @git-amend

    @git-amend

    26 күн бұрын

    Lots more videos on the way.

  • @bazzboyy976
    @bazzboyy97626 күн бұрын

    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

    26 күн бұрын

    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

  • @garryguan7115
    @garryguan711526 күн бұрын

    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
    @erikafurudo996026 күн бұрын

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

  • @git-amend

    @git-amend

    26 күн бұрын

    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.

  • @launemax
    @launemax26 күн бұрын

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

  • @git-amend

    @git-amend

    26 күн бұрын

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

  • @z-time3291
    @z-time329126 күн бұрын

    FUEGO BEBE OTRO TUTO

  • @git-amend

    @git-amend

    26 күн бұрын

    Thanks for watching!

  • @user-fm9wx4wc8h
    @user-fm9wx4wc8h26 күн бұрын

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

  • @git-amend

    @git-amend

    26 күн бұрын

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

  • @TheReverseSide21
    @TheReverseSide217 күн бұрын

    What was the software used for making those diagrams?

  • @git-amend

    @git-amend

    7 күн бұрын

    It's called Excalidraw

  • @AirburstStudios
    @AirburstStudios26 күн бұрын

    Finally a Programming-Centric KZreadr 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 күн бұрын

    Thanks! Glad you’re here!

  • @1ulicaaNerd

    @1ulicaaNerd

    23 күн бұрын

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

  • @horusvengador8829
    @horusvengador882910 күн бұрын

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

  • @git-amend

    @git-amend

    10 күн бұрын

    Excalidraw: kzread.info/dash/bejne/oWSZ2q1mqKm2Y84.html

  • @martinvanstein.youtube
    @martinvanstein.youtube27 күн бұрын

    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

    27 күн бұрын

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

  • @abclef
    @abclef23 күн бұрын

    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

    23 күн бұрын

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

  • @ceeayestro
    @ceeayestro27 күн бұрын

    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 күн бұрын

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

  • @ceeayestro

    @ceeayestro

    26 күн бұрын

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

  • @martin-schoen
    @martin-schoen21 күн бұрын

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

  • @git-amend

    @git-amend

    21 күн бұрын

    I hadn't even noticed that lol

  • @landosilva
    @landosilva26 күн бұрын

    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

    26 күн бұрын

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

  • @user-rm2pj9jf8s
    @user-rm2pj9jf8s26 күн бұрын

    WOW

  • @git-amend

    @git-amend

    26 күн бұрын

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

  • @user-rm2pj9jf8s

    @user-rm2pj9jf8s

    26 күн бұрын

    @@git-amend always useful

  • @fleity
    @fleity26 күн бұрын

    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
    @ggwp861826 күн бұрын

    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!

  • @nehal_chandra2777
    @nehal_chandra277727 күн бұрын

    W

  • @git-amend

    @git-amend

    27 күн бұрын

    👍

  • @midniteoilsoftware
    @midniteoilsoftware27 күн бұрын

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

  • @git-amend

    @git-amend

    27 күн бұрын

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

  • @Haddleton
    @Haddleton22 күн бұрын

    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
    @reggieisnotadog484126 күн бұрын

    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

    26 күн бұрын

    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
    @FiazItik8 күн бұрын

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

  • @git-amend

    @git-amend

    8 күн бұрын

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

  • @FiazItik

    @FiazItik

    8 күн бұрын

    @@git-amend thanks a lot.

Келесі