Is RichAI rewrite/cover/Overwrite Transform's rotation?

  • A* version: [5.1.4]
  • Unity version: [2022.3+]

I am using RichAI to control monster’s movement. One behavior is that :
after monster reaches destination , it rotates to Player and shoot a magic attack.
on this part, I simply use tranform.Lookat( player transform ) to implement it.

        public virtual void FeaturedMoveBehavior()  // this method is call within OnUpdate() method
        {

            if (!isEscaping)
            {
                SwitchState(MonsterIdleState);
                return;
            }

            if (pathPoints.Count < 1)
            {
                SwitchState(MonsterIdleState);
                return;
            }

            PlayMonsterAnimation(MoveTransition, monsterInfo.MoveSpeedRatio);

            monsterPathFinding.destination = pathPoints[nextPathPointIndex];

            if (monsterPathFinding.reachedDestination)
            {
                if (nextPathPointIndex == pathPoints.Count - 1)
                {
                    isEscaping = false;
                    return;
                }

                nextPathPointIndex++;
   
                SwitchState(MonsterAttackState);
                return;
            }
        }

   public virtual void MonsterAttack()
   {
 
       isAttacking = true;

       if (GamePlaySystem.Instance.PlayerTransform != null)
       {
           Debug.Log($"Before LookAt: {RotatableBuddyPart.rotation.eulerAngles}");
           RotatableBuddyPart.LookAt(GamePlaySystem.Instance.PlayerTransform);
           Debug.Log($"After LookAt: {RotatableBuddyPart.rotation.eulerAngles}");
       }
}

However, after the code past the Tranform.LookAt( ) part, the its rotates back to its previous moving direction. and shoot its attack. all of it happens within a frame. I checked it by adding Debug log before and after tranform.LookAt() and OnLateUpdate() Unity lifecycle method.

How can I avoid this happen?

I also tried set RVO 's locked to True, it doesn’t work.

You’ll need to have updateRotation disabled to decouple the rotation so you can manually set it.

As an aside, RichAI is “Kept for compatibility only. If you are starting a new project, the FollowerEntity script is better in almost every way.”. Unless your project has a specific need for RichAI and you’re early in enough to switch, I’d recommend looking at some of the other movement scripts.

I am not in early state, it would be very painful if I switch to other scripts.

I read the documents before I started the current project, according the guide it left me the feeling that RichAI is the one has the most coverage on all kinds of situation. I remember that there is a decision flow chart on which should use within the Doc.

Yesterday, I set path to null and set canMove=false as well, along with RVOlocked= true.
it worked, but I don’t know it will cause some blockage to other agents.

Thanks for your advice. I will do some experiments on it.