The swapping between NaviMeshAgent and CharacterController

JOON 5 months ago in Game Creator updated by Marti (Lead Developer) 5 months ago 1

maybe, there are some people who suffering about the swapping automatically between Navi mesh agents and character controller by Game Creator.

I read some codes about all of the LocomotionSystem classes (such as LocomotionSystemFollow, LocomotionSystemTarget and LocomotionSystemDirectional...)

For the better usages, I will explain about this "swapping" shortly. if you prepared baked Navi mesh maps and checked "can use Navigation Mesh" at advenced Parameters of the Character components. then CharacterLocomotion class will get "NaviMeshAgent" even if you didn't add this components at your character.

and, there is first trap hole about this swapping. even you guys set details about Navi Mesh Agent, GC re-writes this as like Character Controller's details (such as heights, radius, accelations.. etc).if you want your character needs to pass very narrow corridors to make player surprised, you need to check both details carefully

sadly, LocomotionSystemRotation and LocomotionSystemDirectional don't use Navi Mesh Agents, so you need to know when Character choose these Locomotion Systems.

When you rotate character's direction, the locomotion rotation is activated, but sometimes, it is moving to target or player with this LSR.... then it makes very weird situations. AI characters keep watching players and he moved left-side or right-side like craps because when he stucked because of obstacles like logs, boxes... so if you want your character is chasing players while he keep watching, I recommand to set his head direction instead of rotating him totally

and there are second traps for navigations. AI character need to focus player character to fight, and melee module sets his Loco System as Directional. so if you want to fight against your melee characters at the dark forest or narrow maze. you need to check "distances between players and characters" to release focus on player. 

sadly, developers can't set kind of Locomotion systems directly, we can set LS by using actions, and sometimes, even if I called "Move to target" or "follow the Player", It can't activate Navi Agent ...

it is final huge trap, Loco System never turn on Navi Agent when I can't find any possible Navi Path. but it dont mean there is no path between AI and destination. you know, when you bake navi mesh map, Unity engine makes some space from obstacles to let chacter avoid obstacles well. if AI entered this spaces with several reasons such as jumps, or melee attacks or teleports when it stoped moving and restart moving again. the solution is baked navi map without large space. if you don't know the reason why AI naver turns on Navi Agent, it just seems "BUG". maybe we can't call it as "bug" but it is very weird logic.

I wish at the GC 2.0, Developer can choose locomotion ways between Chracter Controller and Navi Mesh Agent, and GC never change it automatically. 

Unity version:
Game Creator version:

We do in fact have this distinction in mind, since in 99% of the cases, a character will stick to a locomotion system. GC 2.0 will work differently than the current character system (much more modular) but we've already done some tests (exactly as you put them) and results are very promising.

We will most likely allow to manually set when a character should only use the navmesh and when it should only use the character controller. Moreover, we can later expand it to let the engine choose which one suit best for every moment (like GC 1 does now) or even change it to a completely different one (such as using Rigidbodies and forces for movement).