- Choose your desired creature and place it somewhere in your scene.
- Make sure that the local axes of your creature are correct aligned (the forward direction of your creature should be positive z).
- Your creature should have at least two animations which are suitable for idle and move behaviour.
Note: ICECreatureControl provides both Unity animation systems, MECANIM and LEGACY as well. If you are using MECANIM make sure, that the Animator Controller is ready, otherwise simply create a new Animator Controller and add your desired Animations (btw. it’s not necessary to create transitions, ICECreatureControl will do it on-the-fly).
- Add the ICECreatureControl Component to your creature and open the inspector view of the component.
- If you have no active Creature Register in your scene click the related Button to add or activate it.
- Select the START display option to display the relevant settings only and open the Essentials foldout.
- Scroll down to the ‘Motion and Pathfinding’ settings and choose the desired ‘Ground Orientation’ and the desired Ground Check Type (btw. by using RAYCAST you should also define the ground layer).
- Make sure, that ‘Handle Gravity’ is checked and the gravity value is around 9.8.
Note: To simplify the introduction, your creature should be nearly naked – no Collider, no Rigidbody, no NavMeshAgent – so you can see and understand how ICECreatureControl works. Btw. all the named components are supported, but for the first steps the only additional component should be an Animation or Animator component filled with great animations.
- Your creature has successfully passed the physical fitness check and you can continue with the Home settings.
- Go to the ‘Home’ settings and define the home target for your creature.
- Set the selection criteria to zero, so that the home will have the lowest relevance.
- Choose the desired Target Object, which could be each reachable GameObject in your scene
- If you have currently no other objects in your scene, you could also use the terrain or the ground object as target.
- If this is done, you could adapt the offset. (e.g. Use the offset if the original target position is suboptimal and/or not reachable for your creature).
- Set the desired radius of the ‘Random Positioning Range’.
Note: If this value is zero, your creature will move to the TargetOffsetPosition and will be waiting there during the idle time (that’s okay for a guard) but if you want that your creature should do some activities during the idle time, choose a larger ‘Random Positioning Range’ and select the desired update trigger, so that your creature will get constantly new positions and it behaviour looks more natural.
- Now define the ‘StopDistance’
Note: that’s the minimum distance to the TargetMovePosition to complete the current move. Values between 2-3 working well in the most cases. The smaller the ‘StopDistance’ the more precise the move but if the ‘StopDistance’ is too small, it could be, that your creature can’t complete the move, because of its own speed and/or turn limits (btw. in such a case your creature will move circular around the TargetMovePosition, if you see it just increase the ‘StopDistance’ to fix it).
Finally you have to define the desired behaviours of your creature.
- Go to the behaviour section within the Essentials settings.
Note: You’ll see the behaviour options for ‘Rendezvous’, ‘Leisure’, ‘Travel’, ‘Dead’ and ‘Respawn’.
- Press now the AUTO Button of the ‘Leisure’ behaviour to create an empty behaviour mode, which will automatically labelled and assigned as ‘LEISURE’.
Please note, that the name of a behaviour is its unique key, which allows you to reuse a behaviour for several targets and situations.
- Press now the Edit Button to configure the LEISURE behaviour.
- Choose the required animation type and select the desired Animation and a suitable WrapMode. Speed should be 1 and the Transition Duration around 0.5 (should be the default values)
- If your selected animation represents a move (such as walk, run etc.) you have to activate the Movement options to adapt the Velocity values for Forward (z) and Angular (y).
Note: The velocity values should be suitable to your selected animation and will needed to be adapted for the best result, but for starting you could use 3 for a ‘walk’ and 6 for a ‘run’ animation and for the angular you could use the half of the forward value.
- Please make sure, that the Popups of ‘Velocity’, ‘Viewing Direction’ and ‘Move’ displays ‘DEFAULT’.
- Now you could close the behaviour editor box by pressing the Edit Button again and repeat the behaviour configuration steps for ‘Rendezvous’, ‘Travel’, ‘Dead’ and ‘Respawn’. (Btw. you can find all behaviours also listed in the Behaviour Foldout)
Congratulation, it’s done! Please save your settings and press play to see the result. If everything is correct, your creature should ‘TRAVEL’ from his origin position to the current TargetMovePosition of its home location. As soon as it inside the ‘StopDistance’, the TargetMovePosition will relocated within the ‘Random Range’ and your creature will follow according to its ‘LEISURE’ behaviour.