Unturned

Unturned

211 ratings
Workshop: Objects
By Nelson Sexton
This guide explains how to create objects for Unturned.
   
Award
Favorite
Favorited
Unfavorite
Intro
Objects in Unturned are the models that make up the detail of maps. The process of exporting objects is shared with items and vehicles as instructed below:
Importing
Unity 5 is used to create objects, and should be installed somewhere on your computer. When you have an empty project open create two folders, one for your source files and one for your bundle contents. Textures, models, etc should go in the source folder and anything specified below as an object should go in the bundle folder.
Format
Data:
  • Type: Every object has either the small, medium or large type. This is used for sorting, pathfinding, collision and culling. Small objects are clutter/decorations, medium objects fill out the layout and large objects make up the level.
  • ID: The object ID is used to spawn it into the game, and is represented as an unsigned 16 bit integer meaning the range [0, 65535]. It is recommended not to use a value less than 2,000 as those are reserved for official content.
  • Snowshow: Specified if this object should not leave a footprint when baking materials.
  • Fuel: Specified if fuel can be retrieved here.
  • Refill: Specified if water can be retrieved here.
  • Soft: Specified if vehicles take damage when crashing into it.
Objects:
  • A gameobject called "Object" tagged and layered with 6, 7 or 8 and 15, 16 or 17 respectively, where 6/15 are large, 7/16 are medium and 8/17 are small. Any renderers can be attached to the root or with LODs as Model_#.
  • For medium or large objects a "Clip" object is needed with only the collision data. This is instantiated on the dedicated server.
  • For large objects and sometimes medium objects a "Nav" object is required with only the navigation data. This is used in the editor when baking navigation meshes.
  • If there are windows or doors where players could place fortifications a "Slots" object tagged and layered with 0 and 8 respectively is used to mark where they can snap. Children named "Slot" represent windows and children named "Door' represent doors.
  • Some large objects that should be seen from long distances can have a "Skybox" object with a MeshRenderer. There's usually no reason for this to have a LODGroup. The mesh for this is a very basic simplification of the object typically less than 30 triangles. Here's a post with some example images: http://blog.smartlydressedgames.com/raising-unturneds-view-distance/
Exporting
Once your object has all the required assets ready you can export your bundle folder as a .unity3d file using the AssetBundle system. My tool for doing this can be found in the Unturned/Bundles/Sources/Tools folder. Follow the README file to set it up. Once that's ready your bundle should be placed in a suitably named folder within the Unturned/Bundles directory. For example, if you are creating a new skyscraper model you might create a folder called "Skyscraper" in Unturned/Bundles/Objects/Large.

Alongside your bundle file you will need a file with the same name, but the .dat extension. This contains all the data mentioned above. Any translations for your object should go here as well, with a minimum of English. New for bundles created with Unity 5.4 and after: include the line "Asset_Bundle_Version 2" in your .dat to disable converting all shaders to the Standard shader.

Note: Some materials may be imported incorrectly by Unturned unless you set color space to Linear rather than Gamma in Unity under Player Settings.
Interactables
Data:
  • Interactability: Which interactable mode to use. Different modes also require different data. Can be set to Binary_State, dropper, note, water or fuel.
  • Interactability_Delay: How long between uses.
  • Interactability_Reset: Time before reset, for example closing doors.
  • Interactability_Hint: Localization key to show. Can be set to door, switch, fire, generator or use.
  • Interactability_Text_Lines: Set in the localization file, number of lines for a note. Interactability_Text_Line_# are the lines of text shown.
  • Interactability_Power: Electricity required. Can be set to none, toggle which requires power to use, or stay which requires power to remain on.
  • Interactability_Editor: Set to toggle if it should swap state in the level editor.
  • Interactability_Nav: Can be none, on or off depending on how navigation should change when the state is changed.
  • Interactability_Drops: Number of drops for a dropper. Interactability_Drop_# are the IDs that can be dropped.
Objects:
  • Binary state interactables need a child named "Root" which can have an animation component with "Open" and "Close" animations and audiosource component triggered when used. A "Toggle" gameobject can be used which will be activated when interacted with.
  • Droppers need a child named "Drop" where the drop will spawn.
Tip: If the sections can't be interacted with make sure that only the "Object" has a kinematic rigidbody.
Interior Culling
Data:
  • LOD: "Mesh" flag which uses the mesh bounds to determine what is inside. For concave objects you can instead use "Area" and add multiple OcclusionAreas for the volumes with objects.
  • LOD_Bias: Multiplier which adjusts the activation distance.
Destruction
Data:
  • Rubble: Which destruction mode to use. Currently only set to "Destroy"
  • Rubble_Reset: Time before respawn.
  • Rubble_Health: Damage which each section can take.
  • Rubble_Effect: ID of effect to spawn on destroyed section.
  • Rubble_Finale: ID of effect to spawn when all sections are destroyed. If this is used all sections dead objects will also be hidden when fully destroyed allowing for example a building to be leveled once the supports are smashed.
Objects:
  • Up to 8 sections of the object can be destroyed (1 byte is used as a bitfield) by creating a child transform named "Sections" with each section parented to that and named "Section_#" OR an easier way if you only want 1 destroyable part is to treat the object itself as a section and not add a sections transform.
  • Each section can have an "Alive" object shown when alive, a "Dead" object shown when dead and an "Effect" transform where the effect will play if set.
  • When making an object with multiple sections the base object can also have its own dead and alive objects, as well as a transform "Finale" where the finale will play if set.
Tip: If the sections can't be destroyed make sure that only the "Object" has a kinematic rigidbody, and that the "Alive" gameobject(s) have colliders.
Measurements
Wall:
  • Depth: 0.5
  • Height: 4.25
Floor:
  • Offset: 5
  • Depth: 0.5
Doorway:
  • Width: 2.5
  • Height: 2.75
Garage:
  • Width: 4
  • Height: 3.75
Window:
  • Offset: 1
  • Height: 2.75
< >
62 Comments
ElRashoMcree Apr 11, 2021 @ 3:14pm 
Somebody know how make a ever render object ? , i mean a object never unrender by distance
Jek'a #MAGICRUST Mar 5, 2021 @ 3:18am 
@cvnt and @Freddy in unity on object add Mech Collider and select your mesh
Freddy Apr 7, 2020 @ 12:40am 
Error in unity. Should have clip object in the hierarchy, edit that to make it fit to urs.
vv
moo shxdy Apr 2, 2020 @ 12:17pm 
I made an object, but I can walk through it. How can I fix this? Is there something that I have to put in the .dat file or did I make an error in unity?
MarcusTheGamer Feb 14, 2020 @ 8:24am 
@TNC 5i10 CHAMPS. Wtf dude calm down jesus
galact1c Oct 15, 2018 @ 2:12pm 
To anyone who still is having struggles with this, Nelson has made a pretty clear video as to how to do it. Hope this helps someone out!

If you have basic knowledge on how to use Blender, this tutorial will help you a lot!

https://youtu.be/rAZ9KEGjSUk
PrayingForTidalWaves Sep 6, 2018 @ 10:14am 
This tutorial really REALLY needs reworking. I'm not new to modelling but have read and re-read this tutorial over and over for an hour now... still completely baffled. All I want to do is put some little clutter items into my game (which I've already made models for), but I can't find a single guide that explains how to do this in plain, simple language. I thought YouTube might be a good resource, but the modding videos are mostly silent with vague subtitles and low res so you can't even read the UIs. Result = no freakin' clue.
If anyone here can point me to a simple, basic tutorial I'd be really grateful; I've not found any at all so far!
100% British Spuds Jul 6, 2018 @ 9:56am 
@commander one take a chill pill :3
crag May 6, 2018 @ 8:27am 
I have so many ideas but i don't understand