wiki.sine.space | sinespace

Difference between revisions of "Full Body Replacement Costumes"

From wiki.sine.space
Jump to: navigation, search
Line 1: Line 1:
{{Revision}} -- Needs clarification of terminology. Avatar vs. Skin, Skeleton, Costume, Outfit etc., especially in the links leading up to the details. How does it all fit together? what's a part of what?
+
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!
  
In space you can customize your avatar skeleton to be anything;  from an alien, or fire elemental, to a dragon.
+
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.
  
There are two parts to this particular feature - Costumes - costumes are an object which replaces your base skeleton mesh with something<br>
+
==Creating Your Costume==
entirely custom. We load the Game Object whole and insert it into the avatar hierarchy on load. The costume can be anything from a box to a particle<br>
+
system such as a fire elemental. You can add custom animations so for an example the particle system could change colors as you walk.<p>
+
  
Note: You will need to use the space asset pack v7.5 or later.<p>
+
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.
  
To Create A Costume
 
  
Create your avatar as a normal game object with whatever elements you want, if it has an animator on it, you should uncheck "Apply Root Motion".<br>
+
===Exporting From 3D Software===
If  ‘Apply Root Motion’ is greyed out,  drag your model into your scene, then drag it back into the assets folder to convert it from a 'Model Prefab' <br>
+
to a plain 'Prefab'.<br>
+
  
If your new avatar is humanoid, you may want it to be compatible with the current avatar animations already in space, or any custom animations you wish to add.<br>
+
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.  
Click on the original FBX file in your Assets,  Under the 'Rig' tab on the Model Importer in the Inspector, select 'Humanoid'. You may need/want to configure this.<br><br>
+
  
[[File:rig.PNG]]
 
<br><br>
 
  
Create a new blank Game Object in your scene, and attach a Clothing Item Settings component.  Under the Clothing Setup slot settings, check them all.<br>
+
===Importing From Unity Asset Store===
The only exception is Animator, only select this if you have created your own custom animator.<br><br>
+
  
[[File:Clothingslots1.PNG]]
+
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.  
<br><br>
+
  
Under Extended Settings there is the Skeleton field. In the Root Template drag the prefab you are using, from the Project Panel <br>
+
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.
for your costume into this slot.
+
  
Tick Attachment,  Click Prepare - and save this new game object as a prefab as you would other clothing items.<br>
+
Make sure you have selected all of the assets by clicking on ‘All’ then click on ‘Import’.  
If your object does not need an animator, you can now upload it. <br><br>
+
This will make a new folder in your Assets folder with all of the items needed for your costume.
  
  
== Uploading Your Costume ==
+
[[File:Warriorimport.jpg|400px]]
  
  
Select the prefab of your costume in the Assets window (not in the Hierachy) and add the Virtual Goods Script’<br>
+
===Importing From 3D Software===
Fill out the mandatory sections and any of the options you want, watch for messages at the bottom of the window when you try to submit, it will tell you what you are missing.<br><br>
+
  
[[File:Shopping.PNG]]<br>
+
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.
[[File:Vendormid.PNG]]<br><br>
+
Upload the item as a piece of clothing, it does not matter which clothing item. The item will upload to your inventory.  
+
  
To wear the costume, open your Inventory , and click on the Costume and select Wear. To unequip, simply wear something else.  Do not use the outfit window.<br>
 
  
Note: If  you don’t want this costume to appear in the store, check Not for Sale in the virtual goods script. <br><br>
+
[[File:Assetimport.jpg|400px]]
+
  
== Creating an Animator ==
 
  
Animators are the second part - this allows you to upload complete custom animations; including as part of another clothing item (e.g. a Beer jug that<br>
+
==Setting Up Your Costume For Upload==
makes you swerve drunkenly).<br>
+
  
Useful Tutorials:
+
===Setting Up A Humanoid Costume===
  
Unity Documentation [https://docs.unity3d.com/Manual/Animator.html]<br>
+
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.  
Humanoid Animation Tutorial [https://unity3d.com/learn/tutorials/modules/intermediate/live-training-archive/setting-up-a-humanoid-avatar]<br>
+
You will find other good tutorials on the Unity Learn website. [https://unity3d.com/learn/tutorials]<br>
+
  
Animators need a controller - to do that, create a new Animator Controller in Unity, and begin laying it out. This is a complex topic, <br>
+
You will have to uncheck the ‘Apply Root Motion’ box if the FBX has an animator already attached to it. 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.
but you can use our own editor pack controller (a smaller version of the full thing) as a template. Search for 'PlayerController' in the editor pack project panel.<br><br>
+
  
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<br>
 
needs to have all these variables listed - even if it does not use them.<br>
 
  
See example:<br>
+
[[File:Rootmotion.jpg]]
[[File:Animatorcontrol.PNG]]<br>
+
 
 +
 
 +
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.
 +
 
 +
 
 +
[[File:Inspectorrig.jpg|600px]]
 +
 
 +
 
 +
===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:
 
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.)<br>
+
*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.<br>
+
*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<br>
+
*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.<br>
+
*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.<br>
+
*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.<br>
+
*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<br>
+
*Is Falling: On/Off - is the user in a falling state
Is Jump: On/Off - is the user currently jumping<br>
+
*Is Jump: On/Off - is the user currently jumping
Is Flying: On/Off - is the user currently flying<br><br>
+
*Is Flying: On/Off - is the user currently flying
[[File:Parameters.PNG]]<br><br>
+
 
[[File:Transition.PNG]]<br><br>
+
See example:
Once you have built your animator, drag it into the clothing item under the Extended Settings, Custom Animation area on the Clothing Item Settings inspector.<br>
+
 
You need to insert the names you used for the variables into the fields. These are case and syntax sensitive (i.e. you should copy them exactly.)<br>
+
 
[[File:Animationscript.PNG]]
+
 
 +
[[File:Animationcontroller.jpg|600px|]]
 +
 
 +
 
 +
 
 +
 
 +
==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.
 +
 
 +
'''Slots'''
 +
 
 +
For costume uploads, you need to make sure all of the slots are checked under the ‘Slots’ segment. Do not check the animator slot.
 +
 
 +
 
 +
[[File:Costumeslots.jpg|400px]]
 +
 
 +
 
 +
After this, check ‘Attachment’ and move on to the Extended Settings.
 +
 
 +
 
 +
'''Extended Settings'''
 +
 
 +
Under the Extended Settings, you will see the ‘Custom Skeleton’ option. Open this up, and you will see ‘Root Template’. This ‘Root Template’ will be the prefab of the FBX you want to use as the costume. Drag the prefab to the box next to ‘Root Template’ from your project window, NOT the hierarchy.
 +
 
 +
 
 +
[[File:Extendedsettings.jpg|500px]]
 +
 
 +
 
 +
'''Finalise'''
 +
 
 +
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.
 +
 
 +
 
 +
'''Uploading'''
 +
 
 +
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.
 +
 
 +
 
 +
[[File:Warriorvirtualgood.jpg|400px]]
 +
 
 +
 
 +
 
 +
==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.  
 +
 
 +
 
 +
 
 +
[[File:Parameterscopy.jpg|800px]]
 +
 
 +
 
 +
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:
 +
*[https://unity3d.com/learn/tutorials/modules/intermediate/live-training-archive/setting-up-a-humanoid-avatar Humanoid Animation]
 +
*[https://unity3d.com/learn/tutorials/topics/animation Animation]
 +
*[https://unity3d.com/learn Unity Learn]
 +
 
 +
 
 +
{{Creation Navbox}}

Revision as of 11:45, 13 January 2017

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.

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.


Warriorimport.jpg


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.


Assetimport.jpg


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 if the FBX has an animator already attached to it. 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.


Rootmotion.jpg


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.


Inspectorrig.jpg


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

See example:


Animationcontroller.jpg



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.

Slots

For costume uploads, you need to make sure all of the slots are checked under the ‘Slots’ segment. Do not check the animator slot.


Costumeslots.jpg


After this, check ‘Attachment’ and move on to the Extended Settings.


Extended Settings

Under the Extended Settings, you will see the ‘Custom Skeleton’ option. Open this up, and you will see ‘Root Template’. This ‘Root Template’ will be the prefab of the FBX you want to use as the costume. Drag the prefab to the box next to ‘Root Template’ from your project window, NOT the hierarchy.


Extendedsettings.jpg


Finalise

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.


Uploading

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.


Warriorvirtualgood.jpg


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.


Parameterscopy.jpg


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: