Documentation and User Guide
Version 1.0 - August 2013
genEric is a complete character ready to drop into your Unity scene. He includes basic animations for walking, running, jumping, falling, turning and crouching. The project also includes an intelligent camera that adjusts to smaller spaces and a sample rooftop environment to run around it.
Table Of Contents
Section 1: Quick Start with the genEric model
Section 3: genEric Model Settings
Section 4: Keyboard And Joystick Controls
Section 5: Creating a Death Volume
Section 6: Setting up Extra Joystick Controls
Section 7: Transferring genEric to Your Own Character
Section 8: Support Information
For a super quick start simply load the sample scene. This has the genEric model all set up and ready to run around. Use the “h” key to expand the on-screen help to see the character controls. You can also plug in a joystick to control the character.
Setting Up genEric In Your Own Scene
1) Add the genEric model into your scene.
The model should be ready to go. Use the arrow keys or the joystick to move around. Hit the "h" key on the keyboard for help.
2) Add the genCamera which will follow genEric around.
If you have an existing camera in the scene you should delete it first. Otherwise it will conflict with the genEric camera.
- Drag the camera from genEric/prefabs/genCamera into the scene.
- Select the "genCamera" in the Hierarchy window.
- look in the inspector panel and ensure that the "Follow Camera" component is opened up. You should see a "Target" parameter in the component.
- Drag the "genEric" model from the Hierarchy window onto the "Target" parameter.
The camera will automatically follow genEric around in the scene.
The genEric Camera has a number of controls to adjust the camera in the scene. You can edit these by selecting the genCamera in your scene and looking in the inspector tab under the genEric Camera Script component.
Target | drag the model you want to follow onto this parameter |
Distance | adjust the distance of the camera to the target |
Height | adjust the height of the camera |
Look at Offset | adjust the tilt of the camera |
Damping | adjust how fast the camera follows the target. Lower numbers are slower and higher numbers faster. |
Manual Offset | rotate the camera around the target. You can also use "[" and "]" on the keyboard for this |
Character Height | Adjust this value if you find that the camera is getting stuck in ceilings |
To access the settings for the genEric model, select the model in your scene window or hierarchy and look in the inspector tab under the genEric Control Script.
Direction Damp Time | lower values make him turn faster and higher values make him turn more slowly. |
Death From Falling Distance | Falling from a height of this distance will kill the character. |
Hard Landing Distance | Falling from this height will trigger a hard landing animation. |
Falling Threshold | This value is falling velocity. If he is falling at least this fast he will transition to a falling animation. |
Extra Joystick Controls | There are a few extra controls that can be added to the joystick controls. These need to be set up in the Input Manager before you can use this feature. See this section for help on setting this up. |
Fatal Object Tag | If genEric collides with an object that has this tag it will trigger a death animation. This is set to “respawn” by default. See this section for help on setting this up. |
Show Help | This toggles whether the on-screen keyboard help is displayed or not. |
There are a number of custom keyboard controls for genEric. The common ones like jump, run and turn can be configured through the Input Manager. The others can be configured in the genEricControl script.
Action | Keyboard | Joystick |
walk forward | w | Left stick up |
run forward | Shift + w | Left stick up farther |
walk backwards | s | Left stick down |
turn left | a | Left stick left |
turn right | d | Left stick right |
turn 180 | shift + s | Left stick push in |
jump | space | Button 0 (Fire 1) |
sidestep left | Shift + a | D-pad left * |
sidestep right | Shift + d | D-pad right * |
turn left while walking | w + a | Left stick forward left |
turn right while walking | w + d | Left stick forward right |
turn left while running | Shift + w + a | Left stick forward left |
turn right while running | Shift + w + d | Left stick forward right |
crouch | c | Button 1 (Fire 2) |
move forward/back while crouching | c + w | Fire 2 + left stick |
toggles running mode. This makes “w” run instead of walking | r | N/A |
rotate the camera to the left | [ | |
rotate the camera to the right | ] |
If you want genEric to die from a collision with a specific object (E.g. bullet, lava, etc), simply create a tag for the death object called “fatal”. This will trigger the death animation on genEric. This is done by setting the “fatalDamage” flag in the mechanim Animator.
If you want to apply damage to the character you can add a hook in the the OnCollisionEnter() method in the main genEricCtrl.cs script.
There are a couple of controls available on the keyboard that require some extra setup if you want to use them with the joystick controls. Unity’s InputManager doesn’t currently allow this to be done through code. The extra controls are sideStep and turn180.
Here’s how to add the additional settings to your Input Manager:
For additional FAQ’s (coming soon), tutorial videos (coming soon) or to submit bugs, comments or feature requests please visit our support page at http://www.bokboklabs.com/support.html.