Triggering Ragdoll Physics (Unity Tutorial)

  Рет қаралды 31,312

Ketra Games

Ketra Games

Күн бұрын

Пікірлер: 84
@AudriusSauciunas
@AudriusSauciunas 2 жыл бұрын
Wow this is the best tutorial channel there is out there for Unity! You're so clear and precise with the way you communicate in your tutorials, I can't believe you only have 5k subscribers, you guys are absolutely amazing!
@KetraGames
@KetraGames 2 жыл бұрын
Thanks so much for this comment 😊
@webbtechsweden
@webbtechsweden 2 жыл бұрын
Agreed!
@lexiferenczy9695
@lexiferenczy9695 2 жыл бұрын
Great video, I'm really fascinated how you not just showed the ragdoll physics but also a simple state machine, charged gunshots, root motion etc ! I definitely would be interested in how to make zombies stand up again! Generally I would be interested in knowing how you go about implementing AI controlled enemies in a game (how root motion could maybe go together with navmesh etc).
@KetraGames
@KetraGames 2 жыл бұрын
Great, thanks for this comment 😊
@keithcollier4860
@keithcollier4860 2 жыл бұрын
Great tutorial! You covered a lot in this one. I definitely would like to see the next part. Would like to see how you can avoid the model snapping into a position when going from rag doll to standing up.
@KetraGames
@KetraGames 2 жыл бұрын
Thanks for this 😊
@zarboos
@zarboos Жыл бұрын
@@KetraGames it dosent work there is error at your code
@PatrickNusbaum
@PatrickNusbaum 2 жыл бұрын
Thanks for this! Definitely show us how to make the zombies stand back up :)
@KetraGames
@KetraGames 2 жыл бұрын
Glad you found it useful 😊
@thesimonjacoby
@thesimonjacoby Жыл бұрын
This is the best ragdoll tutorial for Unity I've seen, thanks for sharing!
@overcookedwalrus4482
@overcookedwalrus4482 2 жыл бұрын
BY FAR, the best tutorial I have seen on this, I am only sorry I didn't find it sooner, have been trying to figure this out for a good amount of time but other tutorials are not clear and very confusing... Thankyou!
@KetraGames
@KetraGames 2 жыл бұрын
Thanks for this comment 😊
@gazzer4461
@gazzer4461 2 жыл бұрын
Thank you for the excellent tutorial! You explain things very well and make everything seem straight-forward.
@KetraGames
@KetraGames 2 жыл бұрын
Great to hear. Thanks 😊
@sorokan6036
@sorokan6036 2 жыл бұрын
Great video, like always! :) I would love to see a video about the transition from ragdoll back to a stand-up animation.
@KetraGames
@KetraGames 2 жыл бұрын
Thanks, we're working on the reverse ragdoll video at the moment! 😊
@Bob-ts2tu
@Bob-ts2tu Жыл бұрын
so well explained and at a pace you can either let roll if you are familiar with the topic without getting bored, or pause to investigate more if needed.
@KetraGames
@KetraGames Жыл бұрын
Thanks so much for this comment 😊
@ilkansuslu1814
@ilkansuslu1814 2 жыл бұрын
Very good tutorial, thanks. I didn't know the enable projection part. And standing up zombies from ground (Ragdoll to Animation) would be. great tutorial. Thankss
@KetraGames
@KetraGames 2 жыл бұрын
Great, thanks for this comment. Glad it was useful 😊
@moishirand5324
@moishirand5324 2 жыл бұрын
great tutorial, how I did not know your channel until today :-)
@KetraGames
@KetraGames 2 жыл бұрын
Thanks for this 😊
@friendgood8518
@friendgood8518 11 ай бұрын
thanks dear ma'am from Afghanistan
@KetraGames
@KetraGames 11 ай бұрын
Thank you 😊
@MsWital
@MsWital 2 жыл бұрын
The divine channel! I watched some videos. Thank you very much!
@KetraGames
@KetraGames Жыл бұрын
Thank you 😊😊
@MoTivE-pw9hb
@MoTivE-pw9hb Жыл бұрын
Thanks nice tutorial just what i needed to know.
@DenysAlmaral
@DenysAlmaral 3 ай бұрын
Thanks!
@uriisgue9743
@uriisgue9743 Ай бұрын
Excellent tutorial
@KetraGames
@KetraGames Ай бұрын
Thank you 😊
@clarkkent1473
@clarkkent1473 10 ай бұрын
No human can speak this perfectly
@KetraGames
@KetraGames 9 ай бұрын
Thanks 😂😊
@krasimirchonov5935
@krasimirchonov5935 2 жыл бұрын
Thank you for this video. It is very helpful and useful.
@KetraGames
@KetraGames 2 жыл бұрын
Great to hear 😊
@muhammedakbey5328
@muhammedakbey5328 2 жыл бұрын
I am thankful to you dude
@KetraGames
@KetraGames 2 жыл бұрын
Thanks 😊
@muffinman999
@muffinman999 2 жыл бұрын
I love your video’s. They are very helpful. I like how you “make mistakes” in your code then go back an edit it to work better. Best way of learning in my opinion. I do have a question though. When using Mixamo to download either a Character or and Animation I don’t get the prompt to save the download to any specific file it just goes straight into my download files. I can get around this by dragging and dropping the download to the Home Screen then dragging and dropping into Unity however I was wondering if you would be able to explain to me how I can get my downloads to save directly to the Unity assets folder the same as yours? Keep up the good work. Thanks
@KetraGames
@KetraGames 2 жыл бұрын
Hi, thanks for this comment 😊 How the files are downloaded may depend on the browser you're using. In the video we use Chrome on Windows, which prompts you to select where you want to download files to. If you're using Edge then by default it goes to the downloads folder. You can change this behaviour if you want. This article may help - www.thewindowsclub.com/enable-save-as-download-prompt-edge
@muffinman999
@muffinman999 2 жыл бұрын
Very helpful, thank you 😊
@bibergames2082
@bibergames2082 2 жыл бұрын
perfect! Please make the zombie stand up again.
@KetraGames
@KetraGames 2 жыл бұрын
Thanks, the stand up video is coming soon!
@ДенисЗаболоцкий-ф4л
@ДенисЗаболоцкий-ф4л 2 жыл бұрын
Thanx for tut! If add non OneShot killing, will be regdoll work correct? If we shot to leg, will be only leg react on shot?
@KetraGames
@KetraGames 2 жыл бұрын
Hi, the ragdoll only works if you disable the animation, so it's all or nothing. If you wanted to have the body part hit react but still have the animation continue then I think you'd have to dynamically alter the animation, maybe using the 'Animation Rigging' package. Hope that helps 😊
@ДенисЗаболоцкий-ф4л
@ДенисЗаболоцкий-ф4л 2 жыл бұрын
@@KetraGames yes, it’s helped! Thanx again!!))
@danegamedev
@danegamedev 2 жыл бұрын
hello ketra can you make tutorial how to make ragdol get up animation after fall
@KetraGames
@KetraGames 2 жыл бұрын
Will do 👍😊
@ani-gamer320
@ani-gamer320 2 жыл бұрын
Thenkus ❤️😉
@KetraGames
@KetraGames 2 жыл бұрын
👍😊
@acasta
@acasta 2 жыл бұрын
Thanks for the tutorial! Quick question, how do you deal with collision detection on the zombie when it's animated (not in ragdoll mode)? I've tried to add a main rigidbody and collider to the model, so it would collide using physics, but this causes issues with the ragdoll rigid bodies and the model flies around. I turned detectCollisions off for the ragdoll bodies, which stop it flying around and allows collision with objects, but now I can't add collision to those for 'bullet' type collisions.
@KetraGames
@KetraGames 2 жыл бұрын
Hi, the Zombie has a CharacterController component attached which will allow it to collide with the scenery, walk up steps etc. Do you need anything in addition to this?
@serdarkaya4557
@serdarkaya4557 Жыл бұрын
thx for video so helpfull ...
@castlecodersltd
@castlecodersltd 2 жыл бұрын
Another great tutorial. Thank you. It would be good to know how to get them to stand back up please
@KetraGames
@KetraGames 2 жыл бұрын
Thanks for this comment 😊 We're planning to release the stand up video tomorrow!
@freeformcreations
@freeformcreations 2 жыл бұрын
Hello Ketra Your astute and detailed and minimalistic approach to coding is worthy of all praises. It is rare to see such clarity these days specially in Unity community! However your code requires a couple of lines more to accommodate some of the out-of-box character setups which do not use ridibodies for the limbs! So I did all that your vides instructed and all worked on Unity 2022.2.x and then manually modified your script a couple of more lines. Mind you, we need to add the Player or find it in gameobjects for this to work. Then your solution worked on the first try! Thank you. If you do approve of my post please delete or ask me to delete. Dara using UnityEngine; public class RagdollDynamic : MonoBehaviour { public Rigidbody[] ragdollbodies; public CapsuleCollider[] colliders; Animator animator; public GameObject player; // Start is called before the first frame update void Start() { ragdollbodies = GetComponentsInChildren(); colliders = player.GetComponents(); animator = player.GetComponent(); DisableRagdoll(); } public void DisableRagdoll() { foreach(var rigidbody in ragdollbodies) { rigidbody.gameObject.SetActive(false); } } public void EnableRagdoll() { Debug.Log("EnableRagdoll"); foreach (var rigidbody in ragdollbodies) { player.GetComponent().isKinematic = true; rigidbody.isKinematic = false; rigidbody.gameObject.SetActive(true); } foreach (var collider in colliders) { collider.enabled = false; } animator.enabled = false; } }
@freeformcreations
@freeformcreations 2 жыл бұрын
Just by viewing one of your videos and your scripting, was able to solve the kill character problem! kzbin.info/www/bejne/ioXdnaWdgpWthrc if you do not approve of posting the link, please delete , or ask me to delete it. Dara
@izaan88
@izaan88 2 жыл бұрын
Seriously, how are you doing this? I was just thinking today of adding ragdoll effects on death to my game
@KetraGames
@KetraGames 2 жыл бұрын
😂 Glad it was useful 😊
@HexOverride
@HexOverride 2 жыл бұрын
Plz make part 2
@webbtechsweden
@webbtechsweden 2 жыл бұрын
At this point in the tutorial I didn't know how to expand the animation: kzbin.info/www/bejne/gaawlml_r52jfKs At the bottom right in the Project tab there is a slider where you can change the size of the project icons. If you drag it fully to the left you can expand the animation
@bigcheese3375
@bigcheese3375 Жыл бұрын
godsend
@JohnTomorrow
@JohnTomorrow 2 жыл бұрын
For anyone following this tut, don't use LINQ in gameplay code. Its slow and expensive
@KetraGames
@KetraGames 2 жыл бұрын
Thanks for pointing this out, you're absolutely right. I wish it was possible to edit videos on KZbin! While LINQ is convenient and reduces the amount of code you need to write, it isn't necessarily the most efficient and it will likely allocate memory, which you want to avoid as much as possible in game development. The following change to the script should be more efficient public void TriggerRagdoll(Vector3 force, Vector3 hitPoint) { EnableRagdoll(); Rigidbody hitRigidbody = FindHitRigidbody(hitPoint); hitRigidbody.AddForceAtPosition(force, hitPoint, ForceMode.Impulse); _currentState = ZombieState.Ragdoll; } private Rigidbody FindHitRigidbody(Vector3 hitPoint) { Rigidbody closestRigidbody = null; float closestDistance = 0; foreach (var rigidbody in _ragdollRigidbodies) { float distance = Vector3.Distance(rigidbody.position, hitPoint); if (closestRigidbody == null || distance < closestDistance) { closestDistance = distance; closestRigidbody = rigidbody; } } return closestRigidbody; }
@itsworm4247
@itsworm4247 2 жыл бұрын
Is there a discord I can join for help?
@KetraGames
@KetraGames 2 жыл бұрын
Sorry, we've not got a discord server at the moment.
@drleandrocorrea
@drleandrocorrea 2 жыл бұрын
Great video. Are some 3d models more "suitable" for the ragdoll wizard? I've been struggling with it for a while, and your zombie feels like was made to be a ragdoll lol. Thx!
@KetraGames
@KetraGames 2 жыл бұрын
Hi, any humanoid model should be fine with the ragdoll wizard. If it's not working for your model, then you can add the physics components by hand. I'd use the wizard on a model it works for, such as the Zombie in the video. Then you can see what components it adds and try to mirror for your model. Hope that helps 😊
@drleandrocorrea
@drleandrocorrea 2 жыл бұрын
@@KetraGames thank you Ketra!
@clarkkent1473
@clarkkent1473 10 ай бұрын
Probs a AI/TTS voice :3
@siduta3326
@siduta3326 2 жыл бұрын
🥰
@KetraGames
@KetraGames 2 жыл бұрын
👍😊
@gcomplex1099
@gcomplex1099 2 жыл бұрын
Hello thanks for the video but i wanna ask something my enemies has navmesh and when i give the zombie script to them navmesh doesnt work
@KetraGames
@KetraGames 2 жыл бұрын
Hi, did you manage to work this out? You may need to replace the code that enables and disables the Character Controller with code that enables and disables the NavMesh agent
@gcomplex1099
@gcomplex1099 2 жыл бұрын
@@KetraGames yes i Just add rigidboy to them and it work
@webbtechsweden
@webbtechsweden 2 жыл бұрын
Why is it that a ragdoll collapses on top of the ground, but if I add a Rigid Body onto the camera it falls through the ground? Okay figured it out, if I add a collider to it it will collide with objects.
@KetraGames
@KetraGames 2 жыл бұрын
Glad you worked it out 👍
@Eduj5790
@Eduj5790 Жыл бұрын
At 18:11 unity doesn't know what zombie is. CS0246
@modestymaccie1223
@modestymaccie1223 Жыл бұрын
Thanks for a superb tutorial, yours are the best ones I have come across! Question: I have followed the tutorial a second time but this time with a Y Bot avatar and a different animation. Everything works except for the fact that the avatar now hovers a little bit off the ground when animated. The animation works but is sort of weird since that avatar does not stand on the ground, the feet are free floating ... Any tips on what caused this?
@KetraGames
@KetraGames Жыл бұрын
Hi, thanks for this comment 😊 The floating might be caused by the Character Controller component. Try raising it slightly to see if that makes a difference
@modestymaccie1223
@modestymaccie1223 Жыл бұрын
@@KetraGames weirdly the avatar can move through the ground during animation. It seems to only interact with the ground when animation is off. I probably need to learn more about animations.
@shingAMarie
@shingAMarie 9 ай бұрын
do you have a tutorial where you actually explain why you are doing what you are doing? For me all of this just sounds like you are reading what you are doing, but not explaining the logic and the concepts.
@KetraGames
@KetraGames 9 ай бұрын
Hi, sorry if you found aspects of the video unclear. Is there anything in particular you need explaining?
Stand Back Up! How to Reverse Ragdoll Physics (Unity Tutorial)
25:37
Active Ragdolls; What Are They And How They Work
9:41
Birdmask Studio
Рет қаралды 43 М.
Which team will win? Team Joy or Team Gumball?! 🤔
00:29
BigSchool
Рет қаралды 14 МЛН
1, 2, 3, 4, 5, 6, 7, 8, 9 🙈⚽️
00:46
Celine Dept
Рет қаралды 71 МЛН
RAGDOLL PHYSICS in Unity!
17:59
Brackeys
Рет қаралды 510 М.
Adding Multiplayer to my Ragdoll Fighting Game
8:02
kbit
Рет қаралды 217 М.
10 Minutes vs. 10 Years of Animation
19:29
Isto Inc.
Рет қаралды 1,1 МЛН
Active Ragdolls in Unity
10:02
Sergio Abreu García
Рет қаралды 141 М.
Building a Tiny Office Pod Under My Stairs
51:47
Man Made
Рет қаралды 8 МЛН
Ragdoll to Standing Improved! (Unity Tutorial)
10:10
Ketra Games
Рет қаралды 9 М.
I Made a Ragdoll Fighting Game | Devlog 1
6:18
kbit
Рет қаралды 818 М.