Gitou

FAQ

Setup and troubleshooting

The enemy does not move at all.

  1. Check the Console. NavAgent2D warns when it has no Movement Profile or cannot find a NavGraph2D.
  2. Select the enemy. Its Inspector flags a missing collider, a missing graph, or a collider that does not match the profile.
  3. Select the NavGraph2D and make sure green node marks appear on the floor. Nodes exist only on empty tiles directly above a solid or one-way tile.
  4. Make sure the target is tagged Player, or assigned in the enemy’s Target field.

The enemy sees me but never chases. Enemies only engage targets they can get at: chasers and flyers need a path to you, the ambusher a spot it can leap from, and the shooter a spot within range with a clear shot. If none exists, the enemy keeps patrolling. This is deliberate and prevents jittering. You can check reachability with the Scene view path test: select the NavGraph2D, then Shift + Click and Ctrl + Click.

The enemy does not notice me. Check detectionRange and line of sight. With requireLineOfSight on, at least one of your head, center or feet must be visible from the enemy’s eyes (eyeHeight). sightBlockers sets which layers block sight. After giving up, an enemy ignores you for reengageCooldown seconds.

Jumps fall short or hit corners.

Enemies get stuck on one-way platforms. The one-way Tilemap needs:

The graph logs a warning when baking if this is wrong. GameObject > GTNav 2D > Nav Graph 2D sets it up for you.

Walking stutters at tile seams. Add a CompositeCollider2D to the ground Tilemap, set the Rigidbody2D to Static, and on the TilemapCollider2D set Composite Operation to Merge (Unity 6) or enable Used By Composite (Unity 2022.3). This merges the tile colliders. The demo scene is set up this way.

Design questions

Can different enemies have different jump abilities? Yes. Give each enemy type its own Movement Profile. Nodes are shared and links are baked per profile.

Can I use my own character controller? Yes. Implement INavAgent on your controller and the behaviours will drive it. You can also use NavGraph2D.FindPath and the NavLink data directly. See the API Reference.

How do I deal damage? The package fires events only: AttackHit (C#) and On Attack Hit (Inspector). Apply damage in your own health system.

Are there jumps a player can make but enemies cannot? A few. Enemies plan jumps with one launch and at most one turn in the air (straight up, then sideways). Moves that need steering several times mid-air, or landing on the very edge of a platform at the limit of the jump, are not planned. See Known limitations.

Can the terrain change at runtime? Yes. Call NavGraph2D.BakeAsync() after modifying the Tilemaps. It rebakes on a worker thread while agents keep using the old graph, then swaps the new one in. Agents repath automatically. Bake() does the same synchronously. See 08_RuntimeBake.

Startup baking takes too long on a big level. Use Bake To Asset in the NavGraph2D Inspector. The graph is then loaded from the asset at startup. Rebake the asset after editing the level. The Inspector warns when it is out of date.

Can I have several graphs? Yes. Agents use the graph assigned to them, or the enabled graph that contains them; an agent that found its graph this way switches to the next graph when it walks into it. The GameObject menu only assigns a graph when the scene has exactly one.

Does it support terrain that is not a Tilemap? Not in v1: NavGraph2D bakes from Tilemaps only, and NavAgent2D and the behaviours need a NavGraph2D. For your own tools, NavGraphBuilder and NavSearch work on a NavGrid you fill by hand.

Is it fast enough for big maps? On a 200×100 map (about 4,400 nodes and 22,000 links):

The EditMode test PerformanceTests reproduces these numbers on your machine.

Is there turn-based or action-point movement? NavPath.TruncateByCost(points) keeps the affordable part of a path. Link costs are roughly seconds of travel time.

My slope tiles are treated as solid blocks. Slopes are detected from the sprite’s physics shape. The tile’s collider type must be Sprite, and the top edge of the shape must be a straight 45° or 1:2 line. If your art does not fit this, list the tiles in a Nav Tile Types asset (see Terrain and Enemy Features).

The enemy will not climb my ladder. Check that:

The enemy never rides my moving platform. At every stop, the platform’s top must be level with a walkable ledge and touch it. Rebake after changing the stops. Agents also skip a ride if walking or jumping is cheaper.

My ranged enemy never fires. It only fires when a shot can reach the target unobstructed, from within maxRange. Check sightBlockers (the layers that block shots) and the projectile’s hitLayers. For arcs, the range is at most about projectileSpeed² / projectileGravity: raise the speed if the target is out of reach.

How do I make a boss? Combine the existing behaviours and swap settings by phase. See Bosses: combining behaviours.

What is not supported yet? Wall jumps and free-form (non-Tilemap) terrain. These are planned for future updates.

Demo and input

The demo throws input errors. The demo supports both the Input System package and the legacy Input Manager. If Project Settings > Player > Active Input Handling is set to Input System Package (New) but the package is not installed, install it or switch to Both.

Can I delete the demo and tests? Yes. Samples and Tests can be deleted. Keep Presets if you use the GameObject menu items. Deleting Samples also removes the Demo Player menu item and the GTNav2D Palette tiles used in the Quick Start.