added animation for weapon(walking)
This commit is contained in:
@ -4,9 +4,12 @@ using static scr_Models;
|
||||
public class scr_WeaponController : MonoBehaviour
|
||||
{
|
||||
private scr_CharacterController characterController;
|
||||
[Header("Settings")]
|
||||
[Header("Settings")]
|
||||
public WeaponSettingsModel settings;
|
||||
|
||||
|
||||
[Header("References")]
|
||||
|
||||
public Animator weaponAnimator;
|
||||
private bool isInitialised;
|
||||
|
||||
Vector3 newWeaponRotation;
|
||||
@ -38,6 +41,8 @@ public class scr_WeaponController : MonoBehaviour
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
weaponAnimator.speed = characterController.weaponAnimationSpeed;
|
||||
|
||||
targetWeaponRotation.y += settings.SwayAmount * (settings.SwayXInverted ? -characterController.input_View.x : characterController.input_View.x) * Time.deltaTime;
|
||||
targetWeaponRotation.x += settings.SwayAmount * (settings.SwayYInverted ? characterController.input_View.y : -characterController.input_View.y) * Time.deltaTime;
|
||||
|
Reference in New Issue
Block a user