Это видео недоступно.
Сожалеем об этом.
Unity Playables is Actually a Game-Changer
HTML-код
- Опубликовано: 17 авг 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.c...
docs.unity3d.c...
Want to support me? 😀
Buy me a coffee! ko-fi.com/adam...
🔔 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.co...
More Useful Code:
github.com/ada...
Unity Utility Library: github.com/ada...
Lock Inspector Hotkey: gist.github.co...
Assets Shown In This Video (Affiliate Links)
More Effective Coroutines: assetstore.uni...
Modular 3D Text: assetstore.uni...
Gridbox Prototype Materials FREE: assetstore.uni...
RamsterZ Loot Anims: assetstore.uni...
Kawaii Animations: assetstore.uni...
Clazy Runner Action Animations: assetstore.uni...
Synty Prototype: assetstore.uni...
Hierarchy Icons: assetstore.uni...
Better Transform: assetstore.uni...
Better Mesh Filter: assetstore.uni...
Kyeoms VFX: assetstore.uni...
Follow me!
linktr.ee/gita...
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!
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.
Would love! Unity 6 is very promising so far :)
All good ideas, I'm taking notes!
Hi. How about covering the topics of Photon Multiplyers?
@@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.
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!
Sounds good, taking notes for a follow up. I’d like to talk about Timeline a bit more as well. Cheers!
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.
Glad it was helpful!
Finally a Programming-Centric RUclipsr for Unity. I always thought it's all about people using assets from the store rather than being real developers first
Thanks! Glad you’re here!
I heard that he's an ex-worker for unity
Hi! Your channel is a real find! I am a unity developer and I find your content very useful. Thank you!
Happy to hear that! Thank you!!
I had never even heard of this. another great video!
Haha, I thought you might like this one! Cheers!
Hi! I was unaware of both Playables, and the More Effective Coroutines asset. Thanks for the info!
No problem!
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!
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!
This video came at a great time. As I was just exploring the Playables API.
Hey awesome!
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
Thanks for the comment, I'll keep your feedback in mind.
I didn't know about this API, thank you for this quick and efficient presentation!
You’re welcome!
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.
Glad to hear that! Thank you!
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.
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.
@@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.
Oh boy, this is a rich repository of resources and crazy useful unity magic instantly. Insta-sub!
Welcome aboard!
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.
Yeah, I think we’ll have to have a follow up video to this one with a more advanced use case.
The unity team must hire you!!! you can make the unity must better!!!!!!
Thanks!
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!
Great idea, I’ll add that to the list!
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.
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.
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.
Hm yeah, they must have done something similar!
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
Another great idea for a video, cheers!
This is such professional content. Amazing work and thanks for sharing the knowledge.
Thank you!
Each video feels like a lesson. Thanks a lot!
Glad you like them!
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.
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.
You beat me to it ;)
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
Another viewer made a similar comment. I've added a coroutines vs async/await discussion video to my TODO list.
Awesome vid! What's the drawing tool you're using to draw the playable graph diagram?
Thank you! The tool is called Excalidraw, you can use it online or integrate it with Obsidian: ruclips.net/video/o0exK-xFP3k/видео.html
I wish I saw this video earlier. Playable graphs have very poor documentation and I had to first reverse engineer some abandoned japanese project to understand how to do blending correctly. But now all animations in our game are using predictable manually time controlled Playable Graphs with perfect rewind.
Just realized that the video only came out a month ago, while I had to figure out playables myself at the end of last year, not surprising I didn't stumble on it.
Rewind seems like a nice use of Playables!
Hot Damn that is wicked, I definitely need more of this.
Great, glad to hear that. I think I'll do one or two more on this topic in a little while.
@@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
That's a good idea, I'll jot that down
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?
You certainly could do that, and in fact that might be optimal.
This + Interactable system.
Insane :)
Haha that's for sure!
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 🤦♂
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!
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.
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).
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!
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
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 !!!
Hey thank you so much! I appreciate the support and the awesome comment!
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.
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
More devlogs please
Lots more videos on the way.
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.
It's unfortunate that the Visualizer was DOA, but to be honest I found it clunky and unnecessary.
Nice!
Thank you! Cheers!
This was a great video
you've got yourself a new subscriber :)
Welcome aboard!
Is this a new API? Since which version? I didn't know this API existed; it seems really useful.
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.
Tiny Bug in your code: in the BlendOut Function, the handle variable should be "blendOutHandle". @10:58
Good eye! I've updated the gist. Thanks.
Interesting, thanks for sharing 🙂
Thanks for watching!
You are the Gem for the Unity Devs!
can you share any of your game.
Thank you... and probably one day I'll do a few dev logs, but might not be for a while.
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.
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!
This is awesome 😎
Glad you liked that! Cheers!
Excelente video y la manera en la que explicas, se aprende mucho y se aprecia.
Thank you!
What setting in Rider are you using for AI code gen?
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)
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)
Personally I find the visualizer clunky, but I suppose it’s better than nothing. Too bad it’s not being developed.
I might sound stupid but at what point did you assign the animations to the objects. Thats the only part that has me lost.
On the Interactable object there is a SerializedField for a clip, which I populated off camera.
@@git-amend Copy. I thought i had missed something. Your videos are a ton of help.
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!
Great suggestion! I've started taking some notes for a future vid!
Cual es la pagina donde hiciste esos diagramas para explicar mejor? 👀
Excalidraw: ruclips.net/video/o0exK-xFP3k/видео.html
What was the software used for making those diagrams?
It's called Excalidraw
FUEGO BEBE OTRO TUTO
Thanks for watching!
WOW
Thanks for watching, hope it’s useful to you!
@@git-amend always useful
Whenever i come to your channel i feel like i dont know shit about unity😅😅😅
Always good to fill in the gaps!
This is a great video, not only because it is the 69th :)
I hadn't even noticed that lol
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.
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.
W
👍
I'm triggered by your use of "magic numbers" for the indexes (e.g. 0 for idle, 1 for walk) - :)
Yeah, in hindsight I should have taken the time to remedy that. Most certainly if the system were to grow any larger!
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!
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.
Hi, what is the texture name that you are using in the plane? @git--amend
That's a free asset called Gridbox Prototype Materials - link in the description.
@@git-amend thanks a lot.
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?
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).
@@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!