RichAI + rigidbody - CharacterController = Not walk

Hello all,

I am very confused as to how to get the agents to get moving. I am trying to port the code from NavMesh to this. I assume CharacterController should do the job but I have a rigidbody attached to the gameobject which breaks it all afaik. RVO Controller as far as I could see could be the alternative so that I don’t change the rigidbody part but it’s not working.

I have set the RichAI on the prefab, added the Seeker, put the speeds and everything and here’s the code:

if( m_AgentMovement != null )
            {
                m_AgentMovement.isStopped = false;
                m_AgentMovement.maxSpeed = m_Data.MovementSpeed;

                m_TargetPosition = new Vector3(
                    m_Target.transform.position.x + m_HordePosition.Position.x,
                    1,
                    m_Target.transform.position.z + m_HordePosition.Position.z
                );
                //m_AgentMovement.onSearchPath += Update;
                m_AgentMovement.destination = m_TargetPosition; //I tried adding that to an Update as well to no avail
                
                m_Controller.SetTarget( m_TargetPosition, m_AgentMovement.maxSpeed,m_AgentMovement.maxSpeed );
            }
public override void Update()
        {
            if( m_AgentMovement.hasPath )
            {
                Debug.DrawLine( p_Intelligence.transform.position, m_TargetPosition, Color.red );

                if( m_AgentMovement.remainingDistance <= m_AgentMovement.endReachedDistance )
                {
                  //
                }
            }
        }

Isn’t there a way to get movement without CharacterController?

After quite a bit of tinkering it seems that the animator was blocking the AI because of use root was selected. Currently it seems to work, I ll keep looking :slight_smile:

1 Like