Modding
If you are interested in modding unturned this guide will hopefully help you get started. This guide likely will not be very in-depth but will help explain the basics of modding the game. This tutorial assumes that you have at least some basic knowledge of how both Blender and Unity works. If you don't you should learn how to use them first.
THIS GUIDE IS INTENDED FOR VERSION 3.23+
Documentation
Official modding documentation can be found here: https://docs.smartlydressedgames.com/en/stable/
Setup
In order to start modding Unturned, you will need:
An installation of the unity editor, which can be downloaded here: https://unity.com/products
An installation of Visual Studio, which can be downloaded through Unity.
A 3D modelling tool, this tutorial uses Blender, which can be downloaded here: https://www.blender.org/download/
An image editing or painting program of your choice.
Once you have installed the required programs:
Create a new 3D project in the Unity editor.
Right click the "Assets" window and press "Import custom package".
Navigate to the Unturned folder, this can be found in steamapps/common. You can find the exact file path by pressing "Browse Local Files" on Steam.
Now that you've navigated to the folder, navigate to the Extras folder and then to the Sources folder. Select ExampleAssets.unitypackage and import it.
If you've done this right, you should see several folders, the one you'll want to use the most is called CoreMasterBundle.
You now need to import another unity package, this one is found in the same folder and is called "Project". Unity will prompt you to open in in a temporary project. Do this.
Find the "Tools" folder and find the Bundle Tool. You now need to get this script to the main project. One method is to make a new script in the main project called "BundleTool", copy the code from the script in the temporary project and paste it in the newly created script. You may also move the script to the main project using the windows file explorer.
Press the Window tab in the Unity Editor (Main Project) and in the dropdown, press Unturned. From there, press Bundle Tool. This will open a new window. The setup is now done!
Creating custom stuff
Once you've completed the setup you can start creating custom items, vehicles and whatever else. This guide will currently only cover crafting supplies and guns. These will however give you a good understanding of how making custom items works and you might be able to figure it out on your own. You can obviously also check other documentation if you need help. (If you know how to make vehicles or other assets you can add it to this page.)
Create a folder for your mod.
Go into the CoreMasterBundle folder and open the Items folder. Here there are many folders of different categories of items. This guide will cover crafting supplies and guns. Melee weapons and other items shouldn't be too hard to figure out once you learn the basics.
Supplies
Navigate to the supplies folder. There will only be one item in the example assets, Money_100. Copy this folder by selecting it and pressing Ctrl + C.
Go to the folder you created. Paste the item. Rename the folder to whatever you'd like, for example, if you're adding a plastic bottle, you could call the folder "Plastic_Bottle". Open the folder.
Inside you will find a prefab called "Item". Do not rename this. Double click it to open the prefab.
You will now see the item with a blue background.
You now need to create a custom 3D model, I'd recommend using Blender. You also need a texture. To make it close to the original art style, simply make a texture with a resolution of only a few pixels, one pixel for every color you need. Save this texture as a .png or .jpg.
Once you've made the model, import the texture into Blender, In the material tab, find the texture interpolation, this will by default be set to Linear, so find and press that. Change it to Closest.
Press the UV editing window and select the parts of the model which you want to be a certain color. Select all of the verticies in the UV window and scale them down to fit within the colored pixel that you want. Repeat this for the other parts of your model which you want to be a certain color. You can of course also use a normal texture, but that will not be explained in this guide.
The model should be ready now. Export it as an FBX and Import both it and the texture into the folder you created in unity, not the folder for the new item you made, rather the main folder for your mod! Select the texture and change the filter mode to "Point (no filter)" and under the Advanced dropdown set Non-Power of 2 to "None".
In the prefab of the new item, select the item and using the inspector, change the mesh to the one you created. Tweak the size and rotation of the Item until you're happy. In the inspector press Recalculate bounds under the LOD group and change the size of the collider to the right size for your model.
The "Icon" object in the hierarchy manages how the icon for the item looks. Rotating it changes the perspective. It basically works as camera which takes a picture of the item, creating the icon. It can be rather difficult to get this right, as it doesn't quite work how you might expect. Moving the object further away or closer to the item won't make it look any different.
The icon of the item may appear too big or too small, or maybe too zoomed in which can cause parts of the icon to not be rendered. To fix, try tweaking the size of the icon object, also make sure that the object is centered relative to the item, and change the rotate if you want. If you can't quite get it right, I recommend copying the transform of the icon in a vanilla item prefab and pasting it in your items icon. This doesn't always work but it can help.
The item is now mostly finished. Now, select the folder for the item and open the bundle tool. Press Grab. Press Bundle [ITEM] and in the explorer navigate to the Unturned folder. Press Bundles, then Items and create a folder for your mod. Create another folder in said folder for your item, name it the exact same thing as your item. Export the bundle in that folder.
You now want to open file explorer, go to the vanilla Items folder and find a crafting supply. Let's use Money_100 again. Copy the two .dat files you find within and paste them in your new items folder where you exported the bundle. Rename Money_100.dat to [YOUR_ITEMS_NAME].dat. Make sure that the name of the bundle (.unity3d) matches the name of the .dat file.
Open the .dat file and delete the GUID. Change the item's ID to whatever you'd like, as long as it isn't the same as any other item. Change the rarity to whatever you want and change the size of the item in your inventory if you want. (Size_X or Size_Y) Write "Exclude_From_Master_Bundle" at the bottom of the file or it will not work!
Now simply edit the english.dat file to change the name and description of the item and you're done!
If you want to tweak, say, the size of the item or the icon you can simply edit the prefab, export the bundle and overwrite the old one.
Guns
Copy the folder of any gun of you're choice to the mods main folder, and rename it.
Delete the included textures as they will not be used. Ignore the animations. You can change the sound files if you wish. Simply import a new sound file with the same name as the one you want to replace. A .mp3 or .wav file works.
Open the Item prefab.
Change the Model_0 model to your custom model. Recalculate the LOD bounds and resize the collider like you did with the supply. Change the mesh for Model_1 as well, this is for the LOD group and is rendered when the player is far away from the item.
Line up Sight with the sights on your gun and move it backwards, this is basically where the camera will go relative to the gun when you aim.
Position Barrel where your guns barrel is. Position Magazine where the magazine should be. Move Eject to where you want the bullet casings to be ejected from. Move grip to where a grip attachment should be, if the gun doesn't accept grip attachments you can just ignore this. Move tactical to where tactical attachments, like flashlights, should be. Move effect to where the muzzle flash should be.
Ignore Icon 2 and Stat_Tracker. Position Icon like you did with the supply item.
Bundle the gun folder the same way as with the supply item and put it in a new folder in the folder you made in the Unturned Items folder. Rename it to the same thing as your bundle.
In the Items folder, find a gun and copy the .dat files. Paste them next to the bundle and rename the gun's .dat file to the same thing as the bundle.
Open the gun's .dat file and delete the GUID. Set the ID to something and set the rarity to whatever you want. Change the player damage and zombie damage to whatever you want. Change the magazine ID to the ID of whatever magazine you want to use. Set the inventory size the same way you did with the supply item. Remember to add the line "Exclude_From_Master_Bundle" at the bottom of the text!
That's the basics of the gun's .dat file covered. Read the documentation listed at the start of the page for more information.
Change the name and description in the english.dat file to whatever you want.
Test the gun and make sure that it works. Tweak it if you need to.
If the give command doesn't work when you try to give yourself a custom item, check Unturned/Logs/Client. Also check the .dat file of the item and make sure that you included the line "Exclude_From_Master_Bundle".