lot's of fixes, fixed animation retargetting, fixed FSM

This commit is contained in:
2025-07-24 17:19:42 +02:00
parent 802eb5ac1d
commit d4d01dfb69
27 changed files with 4381 additions and 2990 deletions

View File

@@ -9,6 +9,68 @@ namespace Beyond
{
public class bControlAIMelee : vControlAIMelee
{
protected override void Start()
{
base.Start(); // Call the original start method
// Be absolutely certain the NavMeshAgent is not controlling rotation
if (navMeshAgent)
{
navMeshAgent.updateRotation = false;
Debug.Log("Forcing NavMeshAgent.updateRotation to FALSE.", this.gameObject);
}
}
/*
/// <summary>
/// We override the base Rotate method. If our animation has the special tag,
/// we do nothing and let root motion handle it. Otherwise, we call the
/// original Invector rotation logic.
/// </summary>
/// <param name="targetDirection">The direction the AI wants to look.</param>
protected override void Rotate(Vector3 targetDirection)
{
//return;
if (IsAnimatorTag("LockRotationToRoot"))
{
// Our special turn animation is playing, so we block
// the AI's attempt to rotate the character manually.
return;
}
// If it's any other animation, let Invector's original code run.
base.Rotate(targetDirection);
}
/// <summary>
/// We must also override the second version of the Rotate method that
/// takes a Quaternion to be thorough.
/// </summary>
/// <param name="targetRotation">The rotation the AI wants to have.</param>
protected override void Rotate(Quaternion targetRotation)
{
//return;
if (IsAnimatorTag("LockRotationToRoot"))
{
// Block manual rotation during our turn animation.
return;
}
// Otherwise, run the original code.
base.Rotate(targetRotation);
}
// --- YOUR ORIGINAL OnAnimatorMove CAN NOW BE SIMPLIFIED OR REMOVED ---
// Your OnAnimatorMove is no longer strictly necessary because we've stopped
// the conflict at the source. However, leaving it in provides a safety net.
// It's your choice to keep it or remove it. For now, let's keep it.
protected override void OnAnimatorMove()
{
base.OnAnimatorMove();
if (useRootMotion && animator != null && Time.deltaTime != 0)
{
transform.rotation = animator.rootRotation;
}
}
*/
public void ResetAnimationTags()
{
if (animatorStateInfos == null)