Colliding with the environment - MotionTooler/MotionToolsWiki GitHub Wiki
This section explains how to add colliders and rigidbodies to the model, to make it interact with the environment.
Note: Make sure you followed the tutorial on how to properly import a model into Unity, before starting with this tutorial.
'Why can't I hit things?'
So you finally imported a humanoid model, you setup the connection between the AXIS Neuron software and Unity and now you wanna play around in your newly created world? Well you can, but it is no fun without collisions with other objects in the world. The object we see moving around in the scene is for Unity's physics engines a ghost. To make them recognize it, we need to add colliders and rigidbodies to the model.
Adding colliders and rigidbodies by hand would be really cumbersome. Luckily our Motion Tools window makes things alot easier, allthough you will still have to tweak some settings.
Adding colliders
Colliders are basically the shapes with which we collide. To make collisions as natural as possible our shapes should match the shape of our models as close as possible.
- Start by opening the Motion Tools window which can be found in the menubar at 'Neuron/Motion Tools'.
- Select the model(s) that need colliders.
- Adding and removing colliders is as simple as pressing the 'Add Colliders' or "Remove Colliders" buttons respectively.
Note: The colliders will be added to the layer mentioned after the name of the model selected. You can change this layer, as well as choose a general layer to add the colliders of all models to, by checking the 'Use general layer to add all colliders' option.
So we are done? Not exactly...
The colliders might have been added, but they will not represent the model's mesh well. To achieve a better result we should take matter into our own hands.
Resizing colliders
- Beneath the buttons for adding and removing colliders the 'Collider Settings' button can be found, which opens a new tab in the Motion Tools window.
- In this tab the size of all the colliders of the model can be set by using the sliders.
Adding rigidbodies
The last thing we need to do know is notify Unity's physics engines that we indeed want to collide and inform them how.
- Open the Motion Tools window again.
- Select the model(s) that need rigidbodies.
- Press the 'Add Rigidbodies' button, located in the bottom left of the window.
You are all set to start colliding with the world, good luck!