Ant Simulator 3D (Unity Asset) — simulator of termite (insect), bug or ant movement with C# code.
Features of Ant Simulator 3D
- Movement, rotation, jump;
- Fully customizable: 3 Parts of Legs, 3 Speeds, Jump Force and more;
- Easy to set up your own ant;
- No Mecanim and legacy animation — only C# code;
- Fast and stable physics simulation;
- Support experimental inverse kinematics, IK;
- Support Unity Free and Unity Pro;
- Full source code included.
- W, A, S, D — move;
- Q, E — rotate;
- Space — jump.
Getting Started with Ant Simulator 3D
Folders & Files in package by default:
- Makaka Games.
If you have any issues with the first launch then just Reach Support with Invoice Number and Get Help.
If you read this tutorial from PDF, first check the latest docs online to get actual information.
- Create New Unity Project with Unity 2018.3.
- Download and import Ant Simulator 3D into Unity;
- Test in Unity Editor or Build.
How to set up your own ant & Prefab
If you use Unity 2018.3 and higher, then just change predefined prefab and save it as new prefab.
Hierarchy of Unity Prefab
It contains a script that controls the movement of an ant (LegsControl.cs) and the only RigidBody component of Ant.
The basis for all other parts. It contains pivot points for legs.
Leg Pivot contains all parts of a leg. The legs are rotating around Leg Pivots.
By default, the legs are the same. However, you can customize each leg individually. Inspector of the control script has separate fields for each part of each leg.
It is necessary to specify the number of legs for an ant. The default value is 6. But you can experiment with other values. We have not tested other cases.
Leg Part: Base, Middle, Final
It is necessary to clearly specify and configure every part of the leg. Specify each Transform for the corresponding field in inspector of the control script.
Start Rotational Angle & Delta Rotational Angle
From what angle leg part starts moving and how many degrees the movement continues.
- Start Rotational Angle = 15;
- Delta Rotational Angle = 15.
- Final Rotational Angle = 15 + 15 = 30.
Sphere for IK
At the end of the hierarchy of prefab, you need to place simple sphere Game Object.
So, the control script understands where each leg is located at any time.
Is it right leg?
Right leg = 1;
Left leg = 0.
Phase Shift & Phase Shift Delta
To simulate the movement of an ant, it is necessary that the opposing legs (relative to the body) were in the same phase of the movement.
The speed of ant movement in the XOZ plane.
The speed of ant rotation around its local Y axis.
Unified the speed of legs movement in any form of movement.
It determines how high the ant will jump up.
Seconds Between Jumping
After how many seconds the next jump is possible?
Inverse Kinematics (IK) — Experimental Mode
Is IK Enabled
If it is false, the ant is suitable for walking on a flat surface.
If it is true, the ant is suitable for walking on a surface with obstacles.
It determines how strongly ant reacts to obstacles, moving other related parts.
Check the current version of Unity Ant Simulator 3D on Asset Store.
The latest versions will be added as soon as possible.
- Unity 2018.3 version.
- Unity 2017.3.1 version.