added animation for weapon(walking)
This commit is contained in:
@ -54,7 +54,11 @@ public class scr_CharacterController : MonoBehaviour
|
||||
private Vector3 newMovementSpeed;
|
||||
private Vector3 newMovementSpeedVelocity;
|
||||
|
||||
[Header("Weapon")] public scr_WeaponController currentWeapon;
|
||||
[Header("Weapon")]
|
||||
public scr_WeaponController currentWeapon;
|
||||
|
||||
public float weaponAnimationSpeed;
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
defaultInput = new DefaultInput();
|
||||
@ -138,6 +142,13 @@ public class scr_CharacterController : MonoBehaviour
|
||||
playerSettings.SpeedEffector = 1;
|
||||
}
|
||||
|
||||
weaponAnimationSpeed = characterController.velocity.magnitude / (playerSettings.WalkingForwardSpeed * playerSettings.SpeedEffector);
|
||||
|
||||
if (weaponAnimationSpeed > 1)
|
||||
{
|
||||
weaponAnimationSpeed = 1;
|
||||
}
|
||||
|
||||
verticalSpeed *= playerSettings.SpeedEffector;
|
||||
horizontalSpeed *= playerSettings.SpeedEffector;
|
||||
|
||||
|
Reference in New Issue
Block a user