mirror of
https://github.com/DerTyp7/defrain-shooter-unity.git
synced 2025-10-29 20:52:10 +01:00
Player walk animations
-Added walk animation -Added strafe animation -Added animation blending for strafe and walk -Added method that controls animation parameters based on movement speed -smol canvas fix
This commit is contained in:
@@ -75,6 +75,7 @@ public class ProcedualAnimationController : NetworkBehaviour
|
||||
[SerializeField] float maxRecoil = 0.1f;
|
||||
|
||||
private Animator gunAnimator;
|
||||
[SerializeField] private Animator playerAnimator;
|
||||
|
||||
Vector3 startPos, startRot;
|
||||
float recoilOffset = 0f;
|
||||
@@ -93,7 +94,11 @@ public class ProcedualAnimationController : NetworkBehaviour
|
||||
Vector3[] positionMod = new Vector3[3];
|
||||
public Quaternion[] rotationMod = new Quaternion[3];
|
||||
|
||||
|
||||
public void walkAnimation()
|
||||
{
|
||||
playerAnimator.SetFloat("x", playerController.localVelocity.x / playerController.currentMaxSpeed);
|
||||
playerAnimator.SetFloat("y", playerController.localVelocity.z / playerController.currentMaxSpeed);
|
||||
}
|
||||
public void OnSwitchWeapon(GameObject currentWeapon)
|
||||
{
|
||||
if (isLocalPlayer) {
|
||||
@@ -135,6 +140,8 @@ public class ProcedualAnimationController : NetworkBehaviour
|
||||
{
|
||||
if (isLocalPlayer)
|
||||
{
|
||||
walkAnimation();
|
||||
|
||||
CmdAim(Input.GetButton("Aim"));
|
||||
}
|
||||
/*-----Aiming-----*/
|
||||
|
||||
Reference in New Issue
Block a user