I know I’m a bit behind but a tip for people still watching. When you wanna make a static body out of a mesh you don’t have to do it manually. With the mesh node selected click the “mesh” button at the top center of the viewport and you can “create trimesh static body” and it well generate a collision shape and static body for you automatically
I've seen the whole 4-part series and succesfully implemented all you had to cover on it. It still holds up. After that, I've been porting it to Godot 4, so I'll leave a list of things I had to change for people in the future. 1) Godot supports blend files now so you can skip the export tool and just import the untitled.blend after you setup the root motion 2) export var and onready var are: *@export @onready* now, and you have to put its type at the end: *@export var anim_tree : AnimationTree* 3) I couldn't get this line to work: *export(Nodepath) onready var anim_tree = get_node(anim_tree)*. I just split it in one export var and one onready var 4) Move_and_slide doesn't take any parameters anymore. Just leave it as is but don't define velocity as a new var, use *self.velocity* which is a property of CharacterBody3D 5) KinematicBody3D is now CharacterBody3D 6) The way to travel to animations within the animation tree state machine changed. Now do: *anim_tree.get("parameters/playback).travel("Idle")* instead of *anim_tree["parameters/playback"].travel("Idle") 7) This one: *anim_tree["parameters/Walking/TimeScale/scale"] = direction.length()* should now be: *anim_tree.set("parameters/Walk/Walking/TimeScale/scale", direction.length())* but I'm not entirely sure yet 8) *var space_state = get_world().direct_space_state* changes to *var space_state = get_world_3d().direct_space_state* 9) And intersect_ray doesn't accept to and from parameters, you have to construct a *PhisicsRayQueryParameters3D* object: *var params := PhisicsRayQueryParameters3D.new()* and do, *params.from = start*, ***params.to** = end* (as the variables in the video are calculated). Then you can do: *var collsion = space_state.intersect_ray(parameters)* 10) Also, intersect ray now returns a dictionary so it's not *col.empty()*, it's *col.is_empty()* The rest of the tutorial is the same, except for the fact that you have to add a world environment and a light to even see your scene. If you have anything to add please tell me, I want to learn more about Godot 4
now I see the reason why my character was moving upwards instead of forward when I hit spacebar. I had to change a lot of lines because I am making this tutorial in august 2022 and using Godot 3.5 and it seems that there are many changes in the engine since 2020! thank you very much
@@Stoonk It's definitely usable. I recommend to backup your files if you choose to upgrade, and even backup when upgrading from alpha to alpha since some of them can break your code and you mght want to roll back. I think we're close enough to the beta that you could reasonably switch. Even if it's not for your main project, you'll do good to make little ones to learn GDScript 2.0. And most important, learn all the little name changes they made to some functions and nodes.
@@wehrwulf88 Yeah! 3.5 has a lot of back porting from Godot 4.0 so you should have to change a lot about it. Although as 3.5 is released and 4.0 is in alpha, you would have an easier time looking for solutions on 3.5. Glad I was able to help. If you make any significant changes feel free to leave a detailed comment so future people can solve their issues as well!
thank you for explaining everything you do. i've yet to start working on my small 3rd person game and your video really helped get some basic understanding!
Perfect! Edit: I would change one small thing. The title doesn't tell people what you're showing off. Imho, you should mention that you're teaching 3D animation imports / controls. Will definitely help drive traffic.
@Forest Kingston So what you're trying to tell me is there a person named "Forrest Kingston" and he is definitely not a bot set up by a scammer. The title is definitely pretty misleading, i only needed the very end and start, but thought there was more in the video I needed to know.
I can't seem to get the character to move. I more or less copied the code, I've got my character and environment set up, and I can get the character to walk in place like at 17:45. No errors are getting thrown, but I can't get it to move. Any idea what might be wrong?
Your videos are amazing! I´m trying to follow your tutorial on Godot 4 beta 10 It seems AnimationTree doesn´t return the Transform anymore, but I found this function get_root_motion_position (returns a Vector3). Is that the one I should use in the script?
Please I beg of you, make a dedicated video called "how to use root Motion in Godot", for the sake of the community, you would be the first one to make that video and it is needed.
It's great that you've shown a way to get animated characters in quickly and easily, but for those of us with no interest in Mixamo, are there any tutorials you can recommend for doing things the more traditional method? I've got no shortage of existing models and animations to use, and none of the first part of this tutorial is of any use to my situation unfortunately. There is a definite shortage of up-to-date Godot tutorials that thoroughly explain the 3D asset pipeline for artists.
Thank you! This is exactly what I needed. To add more, the model imported with the plugin will have some meshes excluded in the current version. To solve this, you can try to download it directly from the Github page :D
Followed your instructions to a T, and I get this "The function 'move_and_slide()' returns a value, but this value is never used". The animation plays, but the player never moves.
Hiii, I've followed every step and the animations work properly but the character always at the same place, there is animation but it does not move at all.
Not sure if anyone else has had this issue, but have gone through the tutorial a few time & keep having an issue with my character moving up instead of forward? Code is the exact same (just before adding gravity & used same animations)
@@hogandromgool2062 there was no such thing in the script as far as i looked. what he actually was doing was adding a constant downward velocity to the normal one when character is not on floor. there was no acceleration. he should've multiplied gravity by delta before adding it. he should also use the return value of move and slide. also you don't use root motion with move_and_slide. because acceleration isn't compatible with root motion unless they are in perpendicular directions at ALL times. 1- he should apply root motion directly with move_and_collide. 2- he should store a global velocity. 3- he should multiply delta by gravity before adding it to velocity 4- he might want to assign the return value of move_and_slide back to velocity if he wishes to add other velocities to the game.
@@darthnegativehunter8659 you're right. It's only in there because I have an addon that automatically manages delta times and I forgot about it. Is there any chance I could get you to write me a short movement scrip for a top down character not using root motion? I don't require it as top down the y translation isn't as noticable. I'm trying to build a diablo style top down game with the camera set to 60deg. Having some serious issues as python is my native language. I can't find a decent script to learn off anywhere. It seems you've built a few. I've only ever use python and Godot seems to use a custom dynamics language and python is pretty static. Struggling to get my head around the base structure of Godot without a decent reference that's not in video format.
I folllowed your tutorial and when I hit play my character still stayed in place instead of moving forward. I can hit spacebar and have the running animation play though.
You may double check if you've imported animation from ximamo without "in place" option. Because this tutorial uses motion from the animation itself (root motion)
Thank you for the video! Something strange that I ran into was that my root motion was really slow. If I multiply the final velocity by 20 the character moves at a normal pace, but otherwise my character is very slow. Any idea why that might be? Thank you again for the great tutorial- very useful for someone making the switch from Unity to Godot!
Hi, nice series. I have a question: why do you divide by delta and not multiply? Also, it seems like camera on the 3rd part along with input handling player script uses camera position from the previous frame, and because of that the character moves with error over long time. Try to increase its speed to see.
move_and_slide is a bit weird (to me). It will multiply by delta itself so you need to pass the velocity per second. So I divide the root motion because move_and_slide will multiply it again.
Lil of off topic. It's fun sometimes to look at others desktop to see what they usually do or play. And I found Cataclysm DDA, omg, is it real that all gamers-programmers play this game? I really like it. Also found PDF on top left with all key binds, lol.
For some reason, "Initialize character" button in Blender add-on importing just armature without mesh. edit: the problem was with specific mixamo character. Other character initializes fine. edit 2: most recent models, not from search, seem to work right.
When I press key bar, it doesn' t move. It stay in the same place and I do everything you do. How to make it move? I'm from Brazil sorry for my english.
@@Ombarus Thank you very much for answering me. This series of tutorials was all I needed to create a 3D character. About your answer, I'll check my code and watch the whole series again to see where my error is. Thank you one more time! :)
Axcellent video! I don't know why, but it took me a long time to discover your youtube channel I would like to ask you a question, I should specify that I am a novice on Godot but that I know Blender well: is that on Godot there is a system which allows to retarget the animations of a character to place them on another model 3D easily and without using Blender? On Unity, for example, there is an automatic retarget system that works extremely well.
I don't think there's a retargetting system in Godot right now. You can export animation ressources and re-use them on similar characters but I don't think it can do retargetting.
woah, i really enjoyed this, loved it. small question, is it possible to, retarget animations, (knowing they use same rig, say humanoids), in godot? trying to get into 3D, and not much of a modeller/animator, so, reusing animations from bought from various asset shops into godot character would be well, simply massive, any ideas on that?, as merging all animations into one file, isn't always an option, especially, when reusing animations for multiple characters
I don't think there is a built-in system for doing retargeting in Godot. There might be alternative solutions in blender or using outside tools but I'm not familiar enough to recommend anything.
@@Ombarus ah shame, to be fair, i can not ever consider godot over unity for 3D, without such tool, for me at least, it seems like, one of the most essential tools to have. hopefully it gets added in the future.
15:50 you can do something like this it will save you a lot of typing and double naming: export(NodePath) onready var animation_tree = get_node(animation_tree) as AnimationTree
@@Ombarus You can use it also with resources, let's say you have some script: class_name MyCustomResource extends Resource ... You can use it in other resource or scene with typed gdscript code competition: export(Resource) var my_resource = my_resource as MyCustomResource
@@donnarieixlucien5212 no, I change code like if Input.is_action_pressed("FORWARD"): direction.z += 1 if direction.z >= Speed: direction.z = Speed _anim_tree["parameters/playback"].travel("Walking")
@@thomasparker7305 some characters don't have the skin(or some is missing) and others the animations don't work well, you just gotta find a character that works and work with that
well I must have screwed up somewhere, because my animations do not loop. I press my walk key and it takes a couple of steps playing through the animation and then comes to a standstill. Any way to fix this or do I need to go back to mixamo and download the animations again with looping on? Thank you for the video though, great walk through and introduction to say the least!!
Normally they should already be set to looping in the AnimationPlayer but if they are not you can just check the little "looping" icon for each animation that need looping in the AnimationPlayer that was imported with the model (if you don't see it you need to right-click on the model and check "editable children").
@@Ombarus I went back to the original AnimationPlayer that was imported with the model and went to the idle, walking, and running animations and turned the looping "on" in the far right corner above the skeleton for all three, however, this did not change anything unfortunately. I'll try restarting godot to see if this resets anything.
@@Ombarus After restarting godot and pulling the project up, the animations are no longer set for looping, even though I saved with control-s after I implemented each change for each animation.
@@Ombarus Well I redid the entire project, brought the gltf file, opened editable children, set idle, run, and walk all to loop before even creating the AnimationTree, but it still only goes through just one cycle of the animation movements. I'm going to go back to mixamo and see if I can download the animations yet again because when I close the project and open it back up, the loop button is no longer active.
@@Darkest-Kn1ght Don't know if you're still struggling with this, but I found a sloution for this problem. First delete the player node from the main scene, deactivate the animationtree in the player scene, save both scenes, restart Godot, open the player scene, apply the looping on the animations, reactivate the animationtree, save the scene, and lastly add the player scene to the main scene.
Hey, I followed your instructions and Codes exactly like you did. The paths on scene are exactly like the one you got. But I got "Invalid get Index 'parameters/playback' (on base: null instance)" and error "Attempt to call Funktion 'get_root_motion_transform' in base 'null instance' on a null instance". What should I do?
@@Ombarus I believe things have changed since this tutorial as I had to read the documentation and change a few things. onready vars must be used now for lookups in parameters
@@Ombarus ....ok, in the video where you make a new scene for player itself, is that saved in same project folder? What's the purpose of making a new scene for player and not in same main scene?
extends KinematicBody export (NodePath) var animationtree onready var _anim_tree = get_node(animationtree) func _physics_process(delta): if Input.is_action_pressed("ui_select"): _anim_tree("parameters/playback").travel("Running") else: _anim_tree("parameters/playback").travel("Idle") it says the method "_anim_tree" isn't declared in the class for this line _anim_tree("parameters/playback").travel("Running") any ideas on how to help? built-in:9 - Parse Error: The method "_anim_tree" isn't declared in the current class. that's in my output
I've had mixed results with the CSGContainer. I also like the idea of being able to quickly turn one of the box into a RigidBody and bounce it around too. In production the best solution would be to make a mockup of the level in blender and just import that I think.
You can reference your AnimationTree just by doing onready var _anim_tree = $AnimationTree the Editor's intellisense should appear and show all accessible nodes that is the children of the script once you type in $ Also, check out the mixamo combiner, it's useful too ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-su8KURZ6vRc.html
Thanks for the video! The only thing I would change is that I would cut more of the very basic stuff - if someone already knows what an animation tree is and also understands accesing node's parameters, he probably knows that the gravity is an acceleration and it's nice to have a variable for it :)
I'm trying a different approach. I've had a lot of comments recently telling me I don't take enough time to explain things. I'm trying to find the right balance!
@@Ombarus I have no problem going through the basics - the only thing that caught my attention was that the inconsistency between the animation and the coding part. But it's more of a minor issue and I just wanted to give some feedback. The video is still great.
Being a beginners tutorial I don't think that would be a smart move. I've never used Godot before so ALL information is needed. When you're writing a tutorial for beginners you assume nobody has any clue what is going on. you assume their grasp on English is terrible also.
AhA! So, on the off chance someone is as stupid as me: When you download the Gadot Game Tools file from viniguerro, LEAVE it in its ZIP form. Don't unzip it. (:
It's not made to be an absolute beginner series. If you're not familiar with programming or gamedev in general you might want to check out stuff from GDQuest they do a really great job with Godot
Hi ! I have a problem... My character goes upward istead of forward can somebody help me ? I have the same code as @Ombarus. The issue probably come to the import but idk what have i done wrong... PS : Si tu lis ce commentaire @Ombarus sache que moi aussi je suis français donc une traduction de ta réponse pourrais m'aider ;)