Тёмный

Godot 3D - State Transitions and Calling Methods | Character Animation Tutorial: 6 

Bonkahe
Подписаться 3,5 тыс.
Просмотров 3,1 тыс.
50% 1

Going over traveling using playback variables from animation trees, not too complex of a subject, but still very necessary.
AnimationTree Docs: docs.godotengine.org/en/stabl...
Github: github.com/Bonkahe/GodotEduca...
Godot: godotengine.org
- timestamps -
00:00 - Intro
00:28 - Modifying Scene / State Machine
04:02 - Programming Changes to Character Controller
09:35 - Implementing Changes to Scene
10:22 - Adding Call Method to Animation
10:54 - Testing Implementation
11:16 - Wrapping Up

Опубликовано:

 

15 июл 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 27   
@davidb1191
@davidb1191 6 дней назад
Maravillosos tutoriales. Esto merece más visitas.
@sansavatar5929
@sansavatar5929 12 дней назад
Wow you're showing c# and gdscript at the same time! awesome video this is insane
@OrionPhilosophy
@OrionPhilosophy Месяц назад
Such a good explanation, thank you man
@Bonkahe
@Bonkahe Месяц назад
Glad I could be helpful!
@kruth6663
@kruth6663 6 месяцев назад
This happens to be the only in-depth 3d character animation tutorial series for godot 4 right now, and it's so well made. Without this series I don't even know what I'm gonna do.
@Bonkahe
@Bonkahe 6 месяцев назад
Thank you so much for the kind words! I'm glad it is being helpful to people, and I'm genuinely surprised it's so hard to find another, maybe that will improve in the future~ Good luck with your projects!
@kruth6663
@kruth6663 6 месяцев назад
@@Bonkahe Thank you, you're truly a life saver!
@CKlidify
@CKlidify 9 месяцев назад
Thanks for showing both the gdscript AND C# code. That's really awesome to see as a dual-user.
@flynsarmy
@flynsarmy Год назад
Loving the series. The big problem I'm having with character animation ATM is with equipping/unequipping/swapping weapons. For example supporting a sword in just right hand or right + left or sword + shield config etc. I hope your series eventually heads in this direction!
@Bonkahe
@Bonkahe Год назад
You know what, next video I will go into that, I'm doing it for Hermit and really there's no reason not to go ahead and go over it, I will be doing a fairly naive approach (no adjustment to the weapon position once it's put in the hand, just whatever the pivot point is), but maybe we can expand it with a further video on the subject of swapping from one weapon to another of a different type (2handed, shield or spear). Thank you for helping me decide that! I was unsure if I wanted to do melee or like a firearm or something with the next one but you solidified that~ Hope you have a wonderful rest of your weekend.
@VoltitanDev
@VoltitanDev 2 месяца назад
I wonder how would a combo attack animations would work with this kind of animation tree set up?
@Bonkahe
@Bonkahe 2 месяца назад
So funnily enough I actually made a combo system for another project with this style of animation set, here's how I did it: The upper body was blended using a filter so it could run independent animations from the lower body, then within there I had the idle with some locomotion for swinging the hands when moving, then I had a branch from there to a drawing animation, and from there to multiple different stances (for each weapon/weapon type), then within those I had 2-3 animations in sequence, with each transition being enabled, with a transition back to the idle also set to enabled, each animation was the same name as the idle for it's weapon type, with a number on the end. Finally on the animations themselves, I had an event that would fire at the beginning and end of the "sweet spot" which was the window in the animation to allow executing the next step in the combo. Then in the code when the begin event went off I switched a bool which enabled stepping forward in the combo chain, (in this case you stepped forward just by attacking again during the sweet spot), each time I registered this input while in the sweet spot, I would disable to combo mode (so as to not allow multiple steps forward in the combo during a single animation), then I would iterate an integer, and set the travel function to "weapon type" + the combo integer (which would reset after every combo), now this of course needs some data, like how many steps for every weapon type, as well as the names of all the weapon types, and of course you would want to actually have some branching/complex options (all of which could be stored in json and interpreted), but even in that simple state I was able to have a pretty solid 1-2-3 hit combo attack, which could break of at any point if the player stopped hitting attack. Hope that gave you a little bit of an idea~
@VoltitanDev
@VoltitanDev 2 месяца назад
@@Bonkahe if the player's animation tree for combos isn't in a separate body part would it be alright if the combo was used in the same sm as the locomotive or just be a nearby state machine of sorts?
@Bonkahe
@Bonkahe 2 месяца назад
Oh for sure, in that case it might be prudent to slow down the players movement during the attacks, or have pre programmed movements (like during an attack move towards the enemy at half speed or something) as otherwise the animation might look a little odd, but yeah should be doable!
@VoltitanDev
@VoltitanDev 2 месяца назад
@@Bonkahe the slow down might not be an issue since the player is a mecha Kaiju.
@Bonkahe
@Bonkahe 2 месяца назад
Hahaha! Fair enough xD Edit: I know you! your work is awesome! we've talked in discord, lol good to see you still going on your project~ Keep up the good work.
@VoltitanDev
@VoltitanDev 2 месяца назад
I was wondering how'd you get the property for the blend path for the locomotion.
@Bonkahe
@Bonkahe 2 месяца назад
I'm not 100% sure if you mean the blend value for a blend2 (or any other blend based animation node for that matter), but that is really simple, just like you can call AnimationTree.set("path to parameter", value) to set a value, you can also use: var value = AnimationTree.get("path to parameter") to get that value. During these tutorials I only use it to get the state of the animation, but you can also use it to just get the current value of any parameter.
@VoltitanDev
@VoltitanDev 2 месяца назад
​@@BonkaheI was referring to 9:31 the property value that's on the locomotive blend before the playback property was added
@Bonkahe
@Bonkahe 2 месяца назад
Oh, you can just select the "Blend Position" text, and right click and select "Copy Property Path", in my case that results in this path: "parameters/LocomotionStateMachine/Locomotion/blend_position" Is that what you meant? lol sorry I'm sometimes a little dense.
@VoltitanDev
@VoltitanDev 2 месяца назад
@@Bonkahe yes that's what I meant
@da_cat
@da_cat 10 месяцев назад
Works great, thank you. The only thing is by using the StateMachine i can't manipulate the speed of the animations separately, i need the jump to be faster than the rest. I need walking faster but Idle needs to stay the same. Now my char blinks faster than a crack addict. Anything else i can use except the TimeScale node ? 🤔 Another thing would be to prevent input when in middle of a jump .. i can glide trough the air while jumping
@Bonkahe
@Bonkahe 10 месяцев назад
Let me tackle those a little in reverse; Preventing movement during jumping is super easy, use is on floor (GDScript: is_on_floor() - C#:IsOnFloor()) to get whether your grounded or not, and if you are grounded then take into account player input, and if you are not just make "curentInput" equal to a Vector2.Zero, (Before it's used in the direction calculation). As for the movement that's a tricky one, in order to manipulate the time of the animations the only current way is TimeScale, so in order to achieve what your wanting (while still being able to actually blend between different movement animations) is to import the animation to blender and shorten it. This can be achieved by just selecting all the animation keyframes in the timeline, and scale them down, the comments are a little old but the principle should be the same as in this forum post: blender.stackexchange.com/questions/5054/how-to-stretch-120-seconds-of-animation-over-270-seconds You can do this for the walking as well, sorry about the convoluted method, but I will say this, once you get the hang of it, this is not even a 2 minute process, so I am sure you'll be able to do it! Good luck, and I hope you have a wonderful day.
@da_cat
@da_cat 10 месяцев назад
Thank you for answering. I ended up completely remaking the AnimationTree without StateMachines, i'm using only simple animations, setting individually their TimeScale before transitioning them and calling them by code manually. Now the only thing left is i want the jump to carry the initial forward velocity when pressing the jump along with the jumping velocity up @@Bonkahe​
@Bonkahe
@Bonkahe 10 месяцев назад
I apologize for the lack of response on this, it doesn't notify me for replies of comments, no idea why. As for carrying over your velocity when jumping, I ran into this a lot, basically the way I resolved it was by instead of zeroing out input when jumping, I retain whatever the last input was before I jumped, and until I hit ground again I just use that velocity, multiplying it by a decay amount each physics frame (just multiplying it by 0.9 or 0.8 works just fine to ease off the velocity), I would definently make the decay amount a different parameter than your usual movement dampening though, so you can handle it separately and just make it decay slower, so you maintain your horizontal velocity during a jump longer than the normal dampening. I'm not able to help more precisely without seeing you code though unfortunately xP I hope I was of some help though!
@da_cat
@da_cat 10 месяцев назад
i'll try, thank you very much@@Bonkahe as for the notifications, i had the same problem, i think the settings for it is in your google account somewhere, i don't remember where exactly, google it lol
Далее
My Puzzle Robot is 200x Faster Than a Human
21:21
Просмотров 8 млн
Environmental Interactions Implementation Tutorial
13:50
I Made the Same Game in 8 Engines
12:34
Просмотров 3,9 млн
How do non-euclidean games work? | Bitwise
14:19
Просмотров 2,4 млн