fix: more movement and observer tweaks and fixes
This commit is contained in:
@@ -90,13 +90,16 @@ namespace NodeCanvas.Tasks.Actions {
|
||||
break;
|
||||
case PlayerFacingDirection.Movement:
|
||||
// Check magnitude to avoid the "Look rotation viewing vector is zero" debug
|
||||
if (controls.rawMoveInput.magnitude == 0) { break; }
|
||||
|
||||
// Set desired rotation to input direction, with respect to camera rotation
|
||||
if (agent.isGrounded){
|
||||
if (controls.rawMoveInput.magnitude == 0) { break; }
|
||||
|
||||
targetRotation = Quaternion.LookRotation(currentMoveDir) *
|
||||
Quaternion.Euler(Camera.main.transform.rotation.eulerAngles.Flatten(0f, null, 0f));
|
||||
} else {
|
||||
if (airMoveDirection.value.magnitude == 0) { break; }
|
||||
|
||||
targetRotation = Quaternion.LookRotation(airMoveDirection.value);
|
||||
}
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user