Halo
I’m writing a hybrid ClickMove and WASD movement, and also using a custom CharacterController
Using RichAI and RVO
updatePosition false (custom move)
When pathfinding, updateRotation
is true, and i feed my CC like so (pseudo code)
myCC.Move(agent.desiredVelocity);
I’m also turning off agent.gravity because the CC handles it
When moving down/upwards, this debug cylinder doesn’t follow
Setting gravity on in RichAI makes it follow, but the debug cylinder is still wrong sometimes
I’ve overrode the RVO with the real velocity result from the CC
if(isServer)
{
if(!pathfinding)
{
rvo.velocity = velocity; // without this, the cylinder wont move at all when WASD
rvo.rvoAgent.Position = transform.position;
} else
{
rvo.rvoAgent.ElevationCoordinate = controller.GetFootWorldPosition().y;
}
}
But i think this is for the RVO and not the agent. In fact, rvo.rvoAgent.Position already follows agent’s position in RVOController.UpdateAgentProperties callback
I think overriding rvo.velocity is correct (when WASD), but the position overriding should be done to the agent, but… i’m not sure how to do that?
agent.position can’t be set, and it points to transform.position if updatePosition is true. But, i don’t want updatePosition…
I seem to be really close here. Everything works until i try to navigate downwards, then upwards through another route (crossing the cliff) when the pathfinding just tries to walk straight over the cliff, on which the CC fails due to slope (obviously). The fail move from the CC causes de-sync to the agent’s position over time…
Cheers