If you want an action camera like the shoot action for the sword action, you can add the code below in the CameraManager script in private void BaseAction_OnAnyActionStarted(object sender, EventArgs e)
case SwordAction swordAction:
Unit swordUnit = swordAction.GetUnit();
Vector3 cameraCharacterHeightSword = Vector3.up * 1.7f;
Vector3 swordDir = swordUnit.GetWorldPosition().normalized;
//float shoulderOffsetSwordAmount = 0.5f; //Add if wanted
//Vector3 shoulderSwordOffset = Quaternion.Euler(0, 90, 0) * swordDir * shoulderOffsetSwordAmount;
Vector3 actionCameraSwordPosition =
swordUnit.GetWorldPosition() +
cameraCharacterHeightSword +
//shoulderSwordOffset +
(swordDir * -1);
actionCameraGameObject.transform.position = actionCameraSwordPosition;
actionCameraGameObject.transform.LookAt(swordUnit.GetWorldPosition() + cameraCharacterHeightSword);
ShowActionCamera();
break;
Then add this code in private void BaseAction_OnAnyActionCompleted(object sender, EventArgs e)
case SwordAction swordAction:
HideActionCamera();
break;