Unity Tutorial: How to trigger a ragdoll on impact using C#

preview_player
Показать описание

Did I make sense? I've only been digging into Unity for about a year, I'm a new-ish programmer teaching newer programmers here, so I don't know what I have to explain and what I don't. Feedback is appreciated.

Me: Makes a video complaining about tutorials that take longer than 6 minutes.

Also me: Makes a 16 minute tutorial
Рекомендации по теме
Комментарии
Автор

thanks for the super useful tutorial! Also I've seen people in comments asking for force applying to the object when getting hit so here's my take on it..

For context, I use a gun on my FPS game, when my gun shoots, the enemy the ragdoll triggers.

I personally get the transform.forward from my FPS camera to determine where the force should be applied relative to where i'm looking. (Also I have my camera as a child of an empty gameobject to keep track of its position).


with all that mentioned I simply make a reference to the player camera using - [SerializeField] GameObject playerCam; - (and reference it from inspector)
then inside EnableRagdoll() into Rigidbody foreach, I simply addforce to the rigidbodies using
* 200f, ForceMode.Impulse);

Of course this function would have to be called into another function when you shoot the enemy so it triggers properly.

this was my 30 second smart moment so I hope you enjoyed it (even though this is super basic...)

Seestral
Автор

I'm pretty new to unity. When you were fleshing out getting the ragdoll parts you said about writing collider then adding [ ] "which means it's an array".

THANK YOU.

I've added those from so many tutorials and you are the first person who actually said what they mean.

jstra
Автор

I can't believe I discovered such a genius so late.
I blame YouTube. I have been searching for all the right terms for your videos, but they never showed up until today.
Anyway, I seeing you haven't uploaded for the last 9 months worries me though.
Please don't stop making these videos. They are just perfect! ♥

Bruce.B
Автор

this is the exactly i was looking for from whole 5+ days lol

subbed straight away❤❤

ayushgupta
Автор

Best Unity tutorial i have ever seen. Pls continue tutorials!

ahmetalkanduran
Автор

Thanks !
Love the visual explanation, it's really good and on point.

znamiyu
Автор

i love the way you explained everything at the beginning, nice video

gamesfordlegend
Автор

I know its a simple topic but it's still is the best explanation I've ever seen about Ragdoll On/Off switch. Definitely an absolute hit for beginners. Pls keep teaching stuff :)
Edit : Just looked at that simple drawing explanations again and .. You're a very good teacher :)

teknofis
Автор

thank you so much i'see many tutorials but this tutorial helped me a lot keep it up btw love your channel

DaveSucker
Автор

You have a really good explanation. Thank you for this beautiful tutorial.

Resul
Автор

THANK YOU SO MUCH! STRAIGHT TO THE POINT AND FEEL LIKE I'VE ACHIEVED SOMETHING TODAY! THANK YOU!

GlitchVR
Автор

Hey :) Just wanted to let you know that you have a really fun and charismatic way of explaining things on a rather base level! Great job and wonderful sense of humour :'D

cbuckington
Автор

This video saved my ver existance, thank you very much queen, you just won yourself a new
Keep up the great

Enzorojopasion
Автор

Thank you. Simple and effective. i enjoy following you coding because you have a nice clean structurized way and explaining everything great so its really easy to understand! Not only to follow. Thanks witch :D Greetings from a witcher

janpaweii
Автор

Super cool tutorial and your awesome way of teaching love it

ApexPredatorM
Автор

I love the way you do tutorials! Hopefully you decide to do more in the future

Xzarations
Автор

Such a good, energetic, succinct tutorial. 👍

THEMJMAN
Автор

Great tutorial! Now you get new subscriber and i will follow your best programming explanation.

MSSMikos
Автор

THANK YOU SOOOO MUCH DEFO 100% deserved th follow the tav helped so much with my ideas THANK YOUUUU

Fatie
Автор

Very in depth and very understandable, great job!

JaminJelly