fixed: changed how rotation is handled in transition from grounded to air to account for becoming grounded without jumping
This commit is contained in:
@@ -22,6 +22,8 @@ namespace NodeCanvas.Tasks.Actions {
|
||||
//EndAction can be called from anywhere.
|
||||
protected override void OnExecute() {
|
||||
airControlPower = 1f;
|
||||
protected override void OnExecute(){
|
||||
|
||||
}
|
||||
|
||||
//Called once per frame while the action is active.
|
||||
@@ -34,8 +36,9 @@ namespace NodeCanvas.Tasks.Actions {
|
||||
|
||||
// Add air control
|
||||
Vector3 inputVector3 = new(agent.GetComponent<PlayerControls>().rawMoveInput.x, 0f, agent.GetComponent<PlayerControls>().rawMoveInput.y);
|
||||
float originalMagnitude = airMoveDirection.value.magnitude;
|
||||
airMoveDirection.value += Camera.main.transform.rotation * inputVector3 * airControlPower;
|
||||
float originalMagnitude = airMoveDirection.value.magnitude;
|
||||
airMoveDirection.value += Camera.main.transform.rotation.Flatten(0, null, 0) *
|
||||
inputVector3 * airControlPower;
|
||||
|
||||
airMoveDirection.value = Vector3.ClampMagnitude(airMoveDirection.value, originalMagnitude);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user