Unturned

Unturned

Not enough ratings
Unturned - Animal Modding Guide
By gamingtoday093
Non-Beginner Animal Modding Guide which explains all the details creating Animals for Unturned!
   
Award
Favorite
Favorited
Unfavorite
Disclaimer
This is Not a Beginners tutorial rather it expects you to have previous experience in Unity. Although I might update this Guide in the future to make it more Beginner friendly.
Pre-Production - Exporting your Animal
Modelling, Rigging and Animating
Will not be covered in this Tutorial, There are however great amount of resources online if you need help with any of these.

Animal Rig Specifics
Your Armature needs to be Named Skeleton.
To take advantage of Unturned's Animal Multipliers you need to name your Bones specific things:
Skull (Head Multiplier) Spine (Body Multiplier)
Leg Multipliers:
Left_Front Right_Front Left_Back Right_Back
If your Bone is named something else the damage the Animal takes will be the Gun's Base Animal Damage

Animations
Set your Animation Frame Rate to 30 fps.
Listed below are Unturned Animals supported Animations:
Idle (Required)
Run (Required)
Walk (Required)
Eat (May have Multiple if set in the .dat Named and Starting at Eat_0 - Eat_<NUMBER>)
Glance_0 (May have Multiple if set in the .dat Named and Starting at Glance_0 - Glance_<NUMBER>)
Startle (Required, May have Multiple if set in the .dat Named and Starting at Startle_0 - Startle_<NUMBER>)
Attack (Required if Behaviour is Offense, May have Multiple if set in the .dat Named and Starting at Attack_0 - Attack_<NUMBER>)
Animations can be renamed in Unity

Export Settings
The Export Options marked in Red have been changed.
Apply Scaling - Makes your Model the Correct Scale on Export, Also don't Forget to apply rotation and Scale for your Model!
Forward - This is the Forward Direction of your model, It will need to be the same as the direction your Animal is Facing
Only Deform Bones - Exports only the bones you are using, a bit redundant really
Add Leaf Bones - If turned on this will add unnecessary extra bones at the end of every bone, Turn this off

Unity - The Hard Part
Import Settings
Aside from setting up the usual there are a few extra things you need to be aware of when Importing your Animal. Its essential that your Animation Type is set to Legacy or your Animations wont work, This is a quirk with Unturned that you can't get around.
For the Animation Section of your Import Rename all your Animations to their Correct Names, Found in Pre-Production of this Tutorial.
Finally set the Run and Walk Animation Clip's Wrap Mode to Loop or they wont loop properly.
Animal_Client
Copy the Example Animal_Client into your Scene and unpack the Prefab.
Drag your own Animal into the Scene and Rename the Top GameObject to Character and Mark all GameObjects with Tag Agent (Animal) and Layer Agent (Zombie / Entity)
Additionally add an LOD Component to your Character GameObject and set it up with your Models. (Unturned Animals use 3% Culled)
Make sure that your Armature is named Skeleton, it's important! (If not rename it in your 3D Software, Never rename a bone in Unity)
The Next step is to add Hitboxes to the Bones you want to have one. They must be set to Is Trigger TRUE and usually uses the Material Flesh. Position them however you'd like but make sure that they are a Component of the Bone you are creating a Hitbox for so it moves with the Animation as well!
Finally, replace the Character in the Animal_Client Example with your own. But before finishing Edit the Size of the Animal_Client's Capsule Collider to Match the Rough Size of your Animal. Then finish off by saving it as a new Prefab.

Animal_Server
Copy your newely created Animal_Client and replace the Capsule Collider with a Character Controller. That has the same Size as the Capsule Collider. Additionally it should also feature these properties:
Save it as a new Prefab.

Animal_Dedicated
Copy your Animal_Server And delete Everything except the Character Controller from it and Save the Prefab.

Ragdoll
To Create the Ragdoll it's best to start with a Clean Slate. Import your Animal into the Scene again and Remove it's Animation Component. Mark all GameObjects with the Tag & Layer Debris and add a LOD the same way as your Animal_Client.

Add a Rigidbody to your Skeleton and add a Character Joint to Every bone. Make sure to Connect your Character Joints with the Correct Bone or your Ragdoll won't behave properly. (How you Parented them in your 3D Modelling Program, + Spine Should be Connected to Skeleton)
Your Ragdoll will also need Hitboxes to interact with the environment, Set these up without a Material. And mark the Spine Bone's Collider as Is Trigger TRUE.

Panics & Roars
Panics will play when the Animal is Damaged, Roars will play when the Animal is Attacking. They should be Imported into the Animal's Folder and Named as such:
Tips & Tricks
Random Noises
If you want your Animal to emit Random noises while Walking Around. Create an Audio file with the Noises you want to play and then simply attach an Audio Component to any Bone such as the Spine inside of your Animal_Client and Set it to Play On Awake and Loop!

Death Cry
A Death Cry is a Sound Effect that plays when your Animal dies. All you have to do to Add a Death Cry to your Animal is to attach an Audio Component anywhere inside of your Ragdoll prefab and Set it to Play On Awake. Easy as that!

If you've Followed this Tutorial Correctly your Animal Folder should now look similar this; and is now ready to be Exported! Yay Unity is Done!!
Customization - .dat Options
.dat Options can be found listed on the Official Unturned Docs Website[docs.smartlydressedgames.com]

If you get stuck or need help don't be afraid to get in touch through Unturned's Official Discord Server[discord.com]
2 Comments
gamingtoday093  [author] 17 Feb @ 7:25pm 
Make sure to increase the Horizontal_Attack_Range in your .dat so that the Animal can attack further away
Sammy 16 Feb @ 7:11pm 
do you know exactly how the animals attack hit box works?
I've tried scaling up a model and it seems unable to attack now.