Let's make Dismemberment in Unity (Tutorial)
Вставка
- Опубліковано 20 сер 2024
- Need help or want to share your work. Join our Discord:
/ discord
Download link for Tutorial Assets:
sky-yurt.itch....
In this tutorial we implement Dismemberment in Unity.
The final goal is to have a character model, that when shot loses a limb and dies. We also implement ragdoll effect, that is activated as soon as the character dies. Moreover, blood effects and wound hole is added to make it more believable.
You can now download the complete pack (including complete scripts and demo scene) at:
sky-yurt.itch....
Twitter: / skyyurt
Discord: / discord
#Unity #Dismemberment #Tutorial - Ігри
Many of you have asked for this. You can now download the complete package (including scripts and demo scene) from here: sky-yurt.itch.io/unity-dismemberment-complete-pack
For those of you who want to save some time, at a cost.
The tutorial and its assets are still freely available.
Setting scale to zero when a limb getting cut off was really clever! I have been developing with unity for many years and never had that idea :D
3 years later and this tutorial is still great. Thank you!
I've been wondering about how to do dismemberment for a very long time.
Never thought about scale the part to 0.
You are a genius!
Just one small problem, if you hit the upper arm, it seems like lower arm will be dismember from the upper arm too.
But I know it can be fixed(?) by create an upper+lower arm object to do it.
Thank you so much for this vid and idea.
This is honestly so cool. Thanks for sharing
Sorry about the loud keyboard sounds!
What should I work on next?
@Lord Maximus Farquaad I will look into it. Planning on making new AI tutorials in the future. Will demonstrate flanking in these tutorials. But to give you a basic idea how to do it: in the tank AI, I use the unity navmesh system and store all the corners of the navmesh. Whenever the AI decides to flank, they get the nearest corner to themself, the nearest corner to the target and two other corners that is not visible to either of the AI and target. Using these 4 corners, we calculate an path, making the AI look like they are flanking, because they don't take the direct path towards the target.
@Lord Maximus Farquaad i usually make the AI track their targets position when in sight, and whenever the AI looses sight of the target, they investigate the last known position of the target, by having navmesh calculate a path towards the position the AI last recorded before losing sight of the player. Afterwards, as you said, you can have preset search positions the AI will visit when they are searching for the player. These positions can be points of interest, for example door openings and behind furniture.
Continue your tutorials on soldier AI
Thank you so much for this! making a zombie arcade game
I've been looking for this quite a long time, thank you!
Thank you very much for the effort in explaining everything! Congratulations! But I would like a little more, how to practically break up characters in Blender! Thanks!
Thank you for the nice words. It's actually fairly easy to make the limbs. What you want to do is import the mesh of the complete model into blender. Afterwards, if you want the arm limb, select every face except the arm and press delete on your keyboard. Now move the arm to the center of blender and export to fbx. Repeat for all limbs. Hope this helps
You are the GOAT for this video man
For your next tutorial try planning it beforehand so you do it quicker and having some coffee so you sound more energized :) Thanks for the video!
Thanks for feedback. I'm still finding it weird talking into a microphone, so i'll have to work on that :)
You are my Hero, thanks for this video
Awesome dude life saver
Man, you are excelent.👏🏻
useful tutorial! thank you, man.
People saying you need to sound more energetic are wrong. I find your voice relaxing. It’s nice
Sky Yurt, this is an awesome video man thanks for uploading something like this.
I have one question, did your model already come with the dismembered parts that you are using or is there a way that you separated the limbs from the base model and made them in to prefabs separate from the model? I currently can't find any limb models that match the ones I am using now and want to know if theres a way to cut my model into limb prefabs like yours? thanks
Thank you!
You can download the tutorial assets including the FPS controller and limbs from link in the description.
To make the limbs I simply imported the base modal into blender (3d modelling software) and manually separated the limbs and exported them as separate models
good one
wow, thank you so much
thank you! This video very helpful!!!
you earned a sub thank you sir
This would be good with lightsabers...
Nice work, very helpful and useful video! :) Working on my sci-fi game/devlog and was thinking how best to approach dismemberment, did not know you can simply scale down each armature once it's imported from Blender. This will really save me a lot of time, thanks again!
👍👍👍
you can't break the keyboard like that,
launch missile.
Face! I'm so glad I learned how to do this. I can't believe I managed to learn something so cool. In a year of study, this is the coolest thing I've learned. The quality of the game goes up a lot with this. Could you give me a hint on how I would use the script for a melee collision? I think the code revolves around Gethit(), but would I use it in a RaycastHit or for melee do I use a collider detection? Thank you very much, friend. You are amazing!
Glad it was helpful.
In the tutorial I use raycast for the weapon, but you can use colliders too. It's the same logic. You just need to change raycasthit with the collider parameter of your collision function.
@@SkyYurt Thanks man. I get it. You are the best! God bless you!
Make more tutorials please
Awesome video. Is it however not possible to instead of replacing the original limb to detach it from the rest of the model and apply the ragdoll to it so that it blows off separately?
In that case you would need a vertex slicer to slice of the limbs. It is doable, but a lot more complex
where did you get the swat model from cause it look cool
Came up with the same idea first but I ended up with artifacts - big triangles standig out of the area, when the scaled down bone was rotated before scaling - so I switched to a shader approach, using vertex colors to influence transparency + alpha clipping.
Works fine, but destroying joints and rigidbodies still keeps me from pooling these objects without causing garbage on the memory.
Now I am searching on some hints to spawn blood decals in a cool way ... currently it's just random and I don't want to add the overhead of particle collisions ...
why woulndt you safe the wound directly intoo the prefab?
hey does any one have any tips on how i could get this to work with melee combat with like colliders and such lol
My question is: How do I export fbx fies in a way that supports dismemberment?
hey. You will have to export each limb in separate fbx files. You can use a tool like Blender 3D to import your character modal and then one by one exporting its' limbs in separate files.
Man I cant see the code you should zoom or maybe edith this video
I get a stackoverflowexception when going to shoot of limbs. Please assist.
hey. Can you share the full error message and at which line in the scripts the error happens and what you have on that line? The problem might be because of a method calling itself infinite times in the code. if It happens when you shoot the limbs, then the problem might lie in the GetHit() method you have in the limb script. Try comparing that method with the content of the method in this video
@@SkyYurt yes it was calling itself over and over. Fixed it after reading the error correctly. Also good tutorial.
Question: Does this work if I import a MakeHuman character?
Yes it should work. You just need to also create separate limb modals for your character. You can do this by importing your character into a 3d Modelling software like blender and separating the limbs manually and saving them in separate files
consider drinking a cup or two of coffee before recording these
do I have to have seprate textures for each limb
you use the same texture and material for each limb and complete character
@@SkyYurt ok thanks a lot man.
full source code?
Hey do you have discord? I need help with something
no sorry, I don't have discord atm. You can ask your question here. This way others can also benefit :)
@@SkyYurt OK sure, but it would be hard to explain without images. So, for example, when I remove the upper part of the leg, the down part just dissapears, the same thing with the arm and the elbow. They just dissapear instead of falling to the ground with its parent.
@@freddiesilverman Take a look at 13:30-13:50 of the video. Maybe you forgot to assign the lower part of the leg as a 'child limb' to the upper part?
@@SkyYurt I actually did that. It's still not fixed. :/
I FIXED IT. Somehow I put 1 in the if(childLimb.Length > 0) so it didn't obey the condicion.
can u give me all script because when i want to make the script, that allway tell me i make mistake… pls
Hey can i use these models in official games?
Yes you can use them. The models are from Mixamo. You can find more free models and animations there
@@SkyYurt thanks for answering.
@@Polarco wait you want the project itself?
@@Polarco the materials are all corrupted.
@@Polarco yes
short