|
Post by esathan1 on Jun 1, 2020 22:20:44 GMT
Hi,
So I would like to achieve when I kill the enemy --> the (for examble) head will fall off. My question is can we achieve this inside of the thid person template (or AI addon template).
I would like to know this before I'm going to (try) writing my own script on this.
Thank you. Kind regards,
Esathan
|
|
Raiox
New vMember
Posts: 14
|
Post by Raiox on Jun 3, 2020 16:39:03 GMT
This is achievable, but the only tie into invector is the bodyparts on the melee manager and the enemy health triggering a death event.
A majority of this you would need to custom code. You would determine which body part was triggered during the death, then you would need a ragdoll most likely with joints that break if that body part was triggered on death. OR make it so the ragdoll prefab's joints break on weapon tag trigger enter which isn't as accurate, but would allow a player to chop up dead enemies. If you don't care about accuracy of which limb was cut off, you can just generate random variations of ragdoll prefabs on death, so in otherwords it may look like you used the sword on the body, but the enemy's head falls off or left arm, this may be appropriate in a hack and slash. Number of enemies, speed of combat and performance are important decisions for determining what may be the best approach.
This then requires some work on the modeling side. Overall, I would think about breakable boxes/glass and how you would use cell fracturing, it's the same idea. If you're unfamiliar with cell fracturing, I would look at the 'The Explorer: 3D Gamekit' from unity. It has boxes that are breakable into cells. Then I would look at some cell fracturing blender tutorials. (not saying you should use cell fracturing on your enemy since it's flesh and not glass/rock, but the idea is similar)
There's probably a million other ways of doing this, but this is how I would approach it. Hope this helps.
|
|
|
Post by kiwi2112 on Dec 14, 2020 8:38:49 GMT
Iv'e achieved this by swapping out my models head texture using events on the damage receiver script with a invisible material and then setting a gore head model with blood n etc. active in its place (assign the body parts different materials when creating them, the event to change the material is SkinnedMeshRender - Material material)
Only got this to work with one hit headshots, any one attack with any weapon to the limb will destroy it. (I can literally one punch an enemies head into bits)
|
|