fixed: changed how rotation is handled in transition from grounded to air to account for becoming grounded without jumping
This commit is contained in:
@@ -51,7 +51,7 @@ namespace NodeCanvas.Tasks.Actions {
|
||||
// Save current velocity and get current input direction
|
||||
Vector3 currentVelocityVector3 = new Vector3(agent.velocity.x, 0f, agent.velocity.z);
|
||||
Vector2 currentInput = agent.GetComponent<PlayerControls>().rawMoveInput;
|
||||
Vector3 currentInputVector3 = new(currentInput.x, 0f, currentInput.y);
|
||||
Vector3 currentInputVector3 = Camera.main.transform.rotation.Flatten(0, null, 0) * new Vector3(currentInput.x, 0f, currentInput.y);
|
||||
|
||||
// Ignore rotation for the current velocity
|
||||
Vector3 currentVelocityWorld = agent.transform.InverseTransformDirection(currentVelocityVector3.normalized);
|
||||
@@ -93,10 +93,6 @@ namespace NodeCanvas.Tasks.Actions {
|
||||
airMoveDirection.value += outputDirection * outputVelocity;
|
||||
}
|
||||
|
||||
// Transform and apply rotatio
|
||||
|
||||
agent.transform.rotation = Quaternion.LookRotation(airMoveDirection.value);
|
||||
|
||||
EndAction(true);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user