Full Body Replacement Costumes
Since Editor Pack 7, all space users now have the ability to create a full body replacement costume. The costume allows you to replace the space avatar base mesh with any object you want, such as another human avatar, an animal or an object; You can even use particle systems as your avatar!
There are two parts to getting a costume working in space. You will need to first create or import your replacement costume, and then you will need to build an animator for this replacement costume. For the animations, you will need to create your own custom animations if you wish to use an object or creature as your replacement costume, but if you are using a humanoid as a replacement, you can use the default space animations, but more in detail on this later on in this guide.
- 1 Creating Your Costume
- 2 Setting Up Your Costume For Upload
- 3 Uploading Humanoid Costumes (No Custom Animations)
- 4 Uploading Humanoid and Other Costumes with Animator
Creating Your Costume
You can create whatever you want to be your replacement costume, whether it be a unicorn, a wrestler or even a fire particle, anything is possible! You can create your own costume in your chosen 3D software and import it into Unity.
Exporting From 3D Software
If you have made your own costume, you will need to export the costume from your chosen 3D software as an FBX file and save it somewhere for importing into Unity later.
Importing From Unity Asset Store
If you have decided to download an object/model to use as your costume from the Unity Asset Store, then you probably won’t have to change the format of the model as most models on the asset store are already in FBX format.
Once the asset has downloaded, it will ask you to import the model into Unity. I am using a warrior princess model for this guide.
Make sure you have selected all of the assets by clicking on ‘All’ then click on ‘Import’. This will make a new folder in your Assets folder with all of the items needed for your costume.
Importing From 3D Software
After the above step of exporting from the 3D software as an FBX file, you can import this into Unity by clicking on ‘Assets’ and choosing ‘Import New Asset’ at the top of the Unity screen. Then choose your FBX file. This will place the FBX file into your Assets folder.
Setting Up Your Costume For Upload
Setting Up A Humanoid Costume
If your costume is a humanoid model, and you want to use it with the default space animations, you will have to get it setup to work with the animations.
You will have to uncheck the ‘Apply Root Motion’ box. You can do this by clicking on the FBX in your hierarchy and finding the ‘Apply Root Motion’ box in the inspector window. If Apply Root Motion is greyed out, drag the FBX into your scene, then back to the project window to create a prefab.
Click on the FBX file you have imported in the project window, and under the Inspector window, choose ‘Rig’, and set the animation type to ‘Humanoid’. This will enable you to be able to use the default space animations for the replacement costume.
Setting up a Non Humanoid Costume with Animator
If you have chosen to use an object or animal as your replacement costume, or you want to create your own animations for a humanoid, you will need to create an animator.
Animators allow you to upload completely custom animations with the replacement costume.
Making A Controller for the Animator
Animators need a controller to work, so you need to create a controller. To create a controller, right click in your project window, and choose ‘Create’ then ‘Animator Controller’ and begin laying it out.
This is a complex step, but you can use the space editor pack controller as a template for laying out the animators; Just search for ‘Player Controller’ in the project window.
An animator controller transitions animations based on input variables - we let you insert a few variables in here (we may add more over time). Your animator needs to have all these variables listed - even if it does not use them.
These variables are:
- Magnitude: runs from 0.0 to 1.0 - 0.0 is standing still, 0.5 is walking, 1.0 is running (approximately. These values may deviate from these general bounds.)
- Angle: Runs from -1.0 to 1.0, 0.0 is not turning. -1.0 is turning left, 1.0 is turning right.
- Vertical: The users key input - moving forward/back shifts this value from -1.0 to 1.0
- Horizontal: As per above, except for the left/right keys.
- Fly Vertical: 0.0 is not moving up/down in flight, -1 is descending, 1.0 is ascending.
- Floor Angle: The normal angle of the floor - used for angling feet to match angled surfaces. Currently disabled.
- Is Falling: On/Off - is the user in a falling state
- Is Jump: On/Off - is the user currently jumping
- Is Flying: On/Off - is the user currently flying
Uploading Humanoid Costumes (No Custom Animations)
After setting the rig type to humanoid, you can go ahead and upload your costume. To upload it, first create a new empty gameobject in your scene. Click on the gameobject in the hierarchy, and click on ‘Add Component’ in the Inspector window. Search for ‘Clothing Item Settings’ and click ‘Add’. This will bring up the clothing item settings. Make sure to expand the ‘Slots’ segment for the next step.
For costume uploads, you need to make sure all of the slots are checked under the ‘Slots’ segment. Do not check the animator slot.
After this, check ‘Attachment’ and move on to Item>Costume.
Under the Costume settings, there will be setting called Referenced Prefab. Drag the prefab of the costume into this box to use this as the root template.
Before preparing, you may need to rename this empty gameobject to something else, otherwise it won’t prepare. You can rename it by scrolling to the top of the Inspector window and clicking in the box right at the top. I renamed mine to ‘Warrior Princess’.
After renaming, click on ‘Prepare’. If it is successful, it will say ‘Re-Prepare’ after a couple of seconds. Save this as a prefab by dragging the gameobject into your project window.
Now you are ready to get the costume uploaded to space. Click on the prefab of your costume in the project window. In the Inspector window, click on ‘Add Component’ and search for ‘Virtual Good’ and add it.
Set the content type to ‘Clothing’ and fill in the rest of the information as you see fit. You can pick any category of clothing for the costume, it doesn’t matter which category it is under.
After it’s all filled out, you can click on ‘Automatic Submission’ to get it uploading to space.
Uploading Humanoid and Other Costumes with Animator
To upload a costume with custom animators, follow the upload steps as above, but check ‘Animator’ under the ‘Slots’ segment.
Scroll down to custom animations, and drag the animator controller you made into the ‘Controller’ slot.
You need to insert the names you used for the variables under the Parameters section into the various fields. These are case and syntax sensitive, so copy them exactly as they are.
After doing this, follow the steps above to make your costume a virtual good with the virtual goods script, and your costume will get uploading to space.
For more information and tutorials on animations, see below: