fixed: changed how rotation is handled in transition from grounded to air to account for becoming grounded without jumping

This commit is contained in:
Chris
2025-07-15 17:00:45 -04:00
parent 920e36ca89
commit 103ffce69b
7 changed files with 99 additions and 10 deletions

View File

@@ -96,9 +96,6 @@ namespace NodeCanvas.Tasks.Actions {
targetRotation = Quaternion.Euler(Camera.main.transform.rotation.eulerAngles.Flatten(0, null, 0));
break;
}
// Set final rotation
agent.transform.rotation = Quaternion.Lerp(agent.transform.rotation, targetRotation, 10f * Time.deltaTime);
// Construct move direction
Vector3 finalMoveDir = Vector3.zero;
@@ -125,6 +122,9 @@ namespace NodeCanvas.Tasks.Actions {
agent.Move((finalMoveDir + gravityMoveDirection) * Time.deltaTime);
}
// Set final rotation
agent.transform.rotation = Quaternion.Lerp(agent.transform.rotation, targetRotation, 10f * Time.deltaTime);
// ???? Moved this above but don't remember if this needs to be here still
if (agent.isGrounded) {
jumpPower.value = 0f;