mirror of
https://github.com/DerTyp7/defrain-shooter-unity.git
synced 2025-10-29 20:52:10 +01:00
added fire animation and fire rate
This commit is contained in:
@@ -18,12 +18,14 @@ public class Headbob : NetworkBehaviour
|
||||
[SerializeField] private Transform Neck;
|
||||
|
||||
private Vector3 lastPos;
|
||||
private Vector3 startPos;
|
||||
private Vector3 newPos;
|
||||
private float oldDist = 0;
|
||||
private float lerpVal = 0;
|
||||
private void Start()
|
||||
{
|
||||
lastPos = this.transform.position;
|
||||
//startPos = this.transform.position;
|
||||
}
|
||||
|
||||
private void Update()
|
||||
@@ -53,19 +55,7 @@ public class Headbob : NetworkBehaviour
|
||||
}
|
||||
else
|
||||
{
|
||||
Neck.localPosition = Vector3.zero;
|
||||
if (false) {
|
||||
Neck.localPosition = Vector3.Lerp(newPos, Vector3.zero, lerpVal);
|
||||
if (lerpVal < 1)
|
||||
{
|
||||
lerpVal = lerpVal + 0.01f;
|
||||
}
|
||||
else
|
||||
{
|
||||
Neck.position = Vector3.zero;
|
||||
}
|
||||
}
|
||||
|
||||
Neck.localPosition = Vector3.zero;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -76,7 +76,7 @@ public class PlayerMouseLook : NetworkBehaviour
|
||||
}
|
||||
playerCamera.position = playerNeck.position;
|
||||
playerCamera.position += playerNeck.up * neckLength;
|
||||
|
||||
|
||||
transform.Rotate(Vector3.up * currentMouseDelta.x * mouseSensitivity); //Rotate the hole player if looked sideways (Rotates the player left and right)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user