Search Results for

    Show / Hide Table of Contents

    Agents

    There are four types of agents each derived from the KaijuAgent class, with the different types defining what drives the movement of the agent:

    1. Transform - Moves directly with the transform. This agent does not collide with object or cause any collision or trigger events to be fired.
    2. Rigidbody - Moves respecting physics using a rigidbody component, allowing for the collisions and their related events to be activated by this agent.
      • If you are unsure of which agent type to use for your use case, it is recommeneded you choose this type to start.
    3. Character - Moves with a character controller component. In general, this behaves about the same as the rigidbody agent.
    4. Navigation - Moves by a navigation mesh agent component, and like the transform agent, does not fire collision or trigger events.
      • Note that all four agent types can fully perform navigation and pathfinding, not just the navigation agent

    Agents must be added to root-level GameObjects, and cannot be nested under other GameObjects. One agent is allowed per GameObject.

    Movement

    Each agent can set their speed and acceleration for performing movements in addition to the look speed. This can be done via the inspector or via the KaijuAgent API.

    Additionally, the KaijuAgent API provides methods exposing how perform all the movements. These movement methods can have their parameters explicitly passed to them. If not passed, all parameters will default to that of the movement configuration assigned to the agent. If no movement configuration is assigned, the values will fallback to the default values outlined in the constant defined in each movement class.

    Controlling Agents

    There is a lot of flexibility as to how you can add intelligent behaviour to agents! The most common method is creating a class which extends from MonoBehaviour (or the extended version provided with Kaiju Agents, KaijuBehaviour instead) and listening for callbacks, accessing properties, and calling methods from the KaijuAgent API. As this workflow is so common, the controller classes provide starting points to do this.

    Identifiers

    For easy comparing of agent types, you can set identifiers for agents, allowing for easy querying with the manager as well as with the included agents vision sensor.

    Spawning and Despawning

    You can either have agents already in the scene when starting the scene which can be created following the instructions in the getting started documentation or at runtime via the KaijuAgents.Spawn(KaijuAgentType, Nullable<Vector3>, Nullable<Quaternion>, Boolean, KaijuAgent, String, Nullable<Color>, Nullable<Color>, ICollection<Type>) method.

    For despawning, you can destroy the agents just like any other GameObject or component, but the better option is to use the Despawn() method. This will keep the agent in memory and allow it to be reused by a future KaijuAgents.Spawn(KaijuAgentType, Nullable<Vector3>, Nullable<Quaternion>, Boolean, KaijuAgent, String, Nullable<Color>, Nullable<Color>, ICollection<Type>) call, thus keeping garbage collection to a minimum.

    In This Article
    Back to top MIT License © 2026 Kaiju Solutions Inc.