Search Unity

CharacterController, NavMeshAgent and AutoSyncTransform

Discussion in 'Physics' started by Unityraptor81, Feb 5, 2018.

  1. Unityraptor81

    Unityraptor81

    Joined:
    Nov 28, 2016
    Posts:
    29
    Hey all,

    Since migrating from 2017.1 to 2017.3, i'm having hard time with the new autosync feature.

    I've set the autosync feature Off, so basically, from what i've read, syncing is done only before physic simulation.

    In my game (VR medieval melee), i have multiple NPCs with kinematic rigibodies and colliders on limbs and non kinematic rididbodies for weapons.

    On the main NPC gameobject, i have a charactercontroller and a navmeshagent

    NPCs are moved :
    - by a navmeshagent when they are far from target or when there is an obstacle
    - by animation rootmotion when the path is clear (Agent is disabled in this case)

    The CharacterController is always enabled to maintain gravity when agent is off and to ensure obstacle collision for both navigation systems.

    In 2017.1, everything was working fine like this.
    In 2017.3:
    - With autosynctransform ON, everything works fine but perfs are awfull
    - With autosynctransform OFF, rootmotion navigation works fine but when navigation is driven by the agent, my npc stays in place until i disable the charactercontroller. But doing so, i also disable collisions with environment.

    I think there is something behind the CharacterController that i don't understand. It seems that when enabled, it overwrites the agent position resulting in no movement.

    If CharacterController specialists have explanations on this behavior.

    Thanks

    Jay / Tale of Glory dev