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
  • Ігри

КОМЕНТАРІ • 72

  • @SkyYurt
    @SkyYurt  2 роки тому +7

    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.

  •  4 роки тому +28

    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

  • @rbjimmy7096
    @rbjimmy7096 9 місяців тому +2

    3 years later and this tutorial is still great. Thank you!

  • @lim9527
    @lim9527 Рік тому +5

    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.

  • @evelyn_day
    @evelyn_day 5 місяців тому +1

    This is honestly so cool. Thanks for sharing

  • @SkyYurt
    @SkyYurt  4 роки тому +12

    Sorry about the loud keyboard sounds!
    What should I work on next?

    • @SkyYurt
      @SkyYurt  4 роки тому +3

      @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.

    • @SkyYurt
      @SkyYurt  4 роки тому +1

      @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.

    • @nemynoodl3
      @nemynoodl3 4 роки тому +1

      Continue your tutorials on soldier AI

  • @plusone8879
    @plusone8879 4 роки тому +7

    Thank you so much for this! making a zombie arcade game

  • @danielmendoza9414
    @danielmendoza9414 4 роки тому +4

    I've been looking for this quite a long time, thank you!

  • @wagnerfernandes4899
    @wagnerfernandes4899 3 роки тому +5

    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!

    • @SkyYurt
      @SkyYurt  3 роки тому +4

      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

  • @Tukyo
    @Tukyo Рік тому

    You are the GOAT for this video man

  • @Marcos10PT
    @Marcos10PT 3 роки тому +5

    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!

    • @SkyYurt
      @SkyYurt  3 роки тому +1

      Thanks for feedback. I'm still finding it weird talking into a microphone, so i'll have to work on that :)

  • @sandityasnoormina1010
    @sandityasnoormina1010 3 роки тому +1

    You are my Hero, thanks for this video

  • @ProspicientVisions
    @ProspicientVisions 2 місяці тому

    Awesome dude life saver

  • @yusufakyol5607
    @yusufakyol5607 10 місяців тому

    Man, you are excelent.👏🏻

  • @erikeviston
    @erikeviston 4 роки тому +1

    useful tutorial! thank you, man.

  • @ACR995
    @ACR995 2 роки тому

    People saying you need to sound more energetic are wrong. I find your voice relaxing. It’s nice

  • @catchingPipsBro
    @catchingPipsBro 4 роки тому +5

    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

    • @SkyYurt
      @SkyYurt  4 роки тому +3

      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

  • @biocronic2986
    @biocronic2986 Місяць тому

    good one

  • @aliakdogan9426
    @aliakdogan9426 4 роки тому +1

    wow, thank you so much

  • @user-dk9nu2xn6n
    @user-dk9nu2xn6n Рік тому

    thank you! This video very helpful!!!

  • @xso8476
    @xso8476 2 роки тому

    you earned a sub thank you sir

  • @nemynoodl3
    @nemynoodl3 4 роки тому +1

    This would be good with lightsabers...

  • @coffeecupstudios5701
    @coffeecupstudios5701 2 роки тому

    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!

  • @cekconi1773
    @cekconi1773 Рік тому

    👍👍👍

  • @batnikelam-mavzer443
    @batnikelam-mavzer443 2 роки тому

    you can't break the keyboard like that,
    launch missile.

  • @CELUGames
    @CELUGames Рік тому

    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!

    • @SkyYurt
      @SkyYurt  Рік тому +1

      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.

    • @CELUGames
      @CELUGames Рік тому

      @@SkyYurt Thanks man. I get it. You are the best! God bless you!

  • @ps5games821
    @ps5games821 4 роки тому +2

    Make more tutorials please

  • @sads0r
    @sads0r Рік тому

    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?

    • @SkyYurt
      @SkyYurt  Рік тому

      In that case you would need a vertex slicer to slice of the limbs. It is doable, but a lot more complex

  • @JJsHowToChannel
    @JJsHowToChannel 2 роки тому

    where did you get the swat model from cause it look cool

  • @johnleorid
    @johnleorid 3 роки тому

    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 ...

  • @DommageCollateral
    @DommageCollateral 3 роки тому

    why woulndt you safe the wound directly intoo the prefab?

  • @coreygrace8937
    @coreygrace8937 Рік тому

    hey does any one have any tips on how i could get this to work with melee combat with like colliders and such lol

  • @theshermantanker7043
    @theshermantanker7043 3 роки тому

    My question is: How do I export fbx fies in a way that supports dismemberment?

    • @SkyYurt
      @SkyYurt  3 роки тому

      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.

  • @flyingroads3498
    @flyingroads3498 2 роки тому

    Man I cant see the code you should zoom or maybe edith this video

  • @ziyaad9454
    @ziyaad9454 3 роки тому

    I get a stackoverflowexception when going to shoot of limbs. Please assist.

    • @SkyYurt
      @SkyYurt  3 роки тому +1

      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

    • @ziyaad9454
      @ziyaad9454 3 роки тому +1

      @@SkyYurt yes it was calling itself over and over. Fixed it after reading the error correctly. Also good tutorial.

  • @later251
    @later251 4 роки тому

    Question: Does this work if I import a MakeHuman character?

    • @SkyYurt
      @SkyYurt  4 роки тому

      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

  • @youngdingle
    @youngdingle 3 роки тому +5

    consider drinking a cup or two of coffee before recording these

  • @franksalot114
    @franksalot114 3 роки тому

    do I have to have seprate textures for each limb

    • @SkyYurt
      @SkyYurt  3 роки тому +1

      you use the same texture and material for each limb and complete character

    • @franksalot114
      @franksalot114 3 роки тому

      @@SkyYurt ok thanks a lot man.

  • @neatlent7255
    @neatlent7255 2 роки тому

    full source code?

  • @freddiesilverman
    @freddiesilverman 4 роки тому

    Hey do you have discord? I need help with something

    • @SkyYurt
      @SkyYurt  4 роки тому +1

      no sorry, I don't have discord atm. You can ask your question here. This way others can also benefit :)

    • @freddiesilverman
      @freddiesilverman 4 роки тому +1

      @@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.

    • @SkyYurt
      @SkyYurt  4 роки тому +1

      @@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?

    • @freddiesilverman
      @freddiesilverman 4 роки тому +1

      @@SkyYurt I actually did that. It's still not fixed. :/

    • @freddiesilverman
      @freddiesilverman 4 роки тому +2

      I FIXED IT. Somehow I put 1 in the if(childLimb.Length > 0) so it didn't obey the condicion.

  • @ed-uh9sh
    @ed-uh9sh 3 роки тому +2

    can u give me all script because when i want to make the script, that allway tell me i make mistake… pls

  • @freddiesilverman
    @freddiesilverman 4 роки тому

    Hey can i use these models in official games?

    • @SkyYurt
      @SkyYurt  4 роки тому +1

      Yes you can use them. The models are from Mixamo. You can find more free models and animations there

    • @freddiesilverman
      @freddiesilverman 4 роки тому

      @@SkyYurt thanks for answering.

    • @freddiesilverman
      @freddiesilverman 4 роки тому

      @@Polarco wait you want the project itself?

    • @freddiesilverman
      @freddiesilverman 4 роки тому

      @@Polarco the materials are all corrupted.

    • @freddiesilverman
      @freddiesilverman 4 роки тому

      @@Polarco yes

  • @sillyninja65
    @sillyninja65 Рік тому

    short