mirror of
https://github.com/DerTyp7/defrain-shooter-unity.git
synced 2025-10-30 13:07:10 +01:00
Fuck nothing works
This commit is contained in:
@@ -10,10 +10,9 @@ public class AimDownSights : MonoBehaviour
|
||||
[SerializeField] GameObject AimPoint;
|
||||
[SerializeField] GameObject HoldPoint;
|
||||
public bool isAiming = false;
|
||||
bool ADS()
|
||||
private void Update()
|
||||
{
|
||||
|
||||
return true;
|
||||
}
|
||||
private void FixedUpdate()
|
||||
{
|
||||
|
||||
@@ -69,10 +69,10 @@ public class Headbob : NetworkBehaviour
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private float getSin(float multiplier, float devisor,float x)
|
||||
//check
|
||||
private float getSin(float amplitude, float frequency,float x)
|
||||
{
|
||||
return multiplier * Mathf.Sin((x/3.14f) * 10 * devisor);
|
||||
return amplitude * Mathf.Sin((x/3.14f) * 10 * frequency);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ using Mirror;
|
||||
|
||||
public class PlayerController : NetworkBehaviour
|
||||
{
|
||||
[SerializeField] private AimDownSights ADSContoller;
|
||||
[SerializeField] private ProcedualAnimationController procedualAnimationController;
|
||||
[Header("Movement")]
|
||||
[SerializeField] private float walkSpeed = 6.0f;
|
||||
[SerializeField] private float sprintSpeed = 10.0f;
|
||||
@@ -33,10 +33,11 @@ public class PlayerController : NetworkBehaviour
|
||||
private float movementSpeed;
|
||||
private float velocityY = 0.0f;
|
||||
private CharacterController controller;
|
||||
|
||||
Vector3 currentPos = Vector3.zero;
|
||||
private Vector3 currentDir = Vector3.zero;
|
||||
private Vector3 currentDirVelocity = Vector3.zero;
|
||||
private Vector3 velocity = Vector3.zero;
|
||||
public Vector3 velocity = Vector3.zero;
|
||||
Vector3 refVelocity = Vector3.zero;
|
||||
|
||||
|
||||
private void Start()
|
||||
@@ -53,7 +54,6 @@ public class PlayerController : NetworkBehaviour
|
||||
Grounded();
|
||||
CheckGoundAngle();
|
||||
UpdateMovement();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -65,8 +65,8 @@ public class PlayerController : NetworkBehaviour
|
||||
|
||||
public bool isMoving()
|
||||
{
|
||||
if (velocity.x == 0 && velocity.y == 0 && velocity.z == 0) return true;
|
||||
else return false;
|
||||
if (velocity.x == 0 && velocity.y == 0 && velocity.z == 0) return false;
|
||||
else return true;
|
||||
}
|
||||
|
||||
private void CheckGoundAngle()
|
||||
@@ -101,14 +101,14 @@ public class PlayerController : NetworkBehaviour
|
||||
{
|
||||
|
||||
|
||||
if (Input.GetAxisRaw("Sprint") > 0 && isGrounded && !ADSContoller.isAiming)
|
||||
if (Input.GetAxisRaw("Sprint") > 0 && isGrounded && !procedualAnimationController.isAiming)
|
||||
{
|
||||
movementSpeed = sprintSpeed;
|
||||
isSprinting = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
if(ADSContoller.isAiming) movementSpeed = aimWalkSpeed;
|
||||
if(procedualAnimationController.isAiming) movementSpeed = aimWalkSpeed;
|
||||
else movementSpeed = walkSpeed;
|
||||
isSprinting = false;
|
||||
}
|
||||
@@ -145,9 +145,7 @@ public class PlayerController : NetworkBehaviour
|
||||
currentDir = moveDirection;
|
||||
}
|
||||
|
||||
velocity = currentDir * movementSpeed + new Vector3(0, velocityY, 0);
|
||||
|
||||
|
||||
velocity = Vector3.SmoothDamp(velocity, currentDir * movementSpeed + new Vector3(0, velocityY, 0),ref refVelocity,0.1f);
|
||||
controller.Move(velocity * Time.deltaTime);
|
||||
|
||||
}
|
||||
|
||||
@@ -27,15 +27,13 @@ public class PlayerMouseLook : NetworkBehaviour
|
||||
private Vector2 currentMouseDelta = Vector2.zero;
|
||||
private Vector2 currentMouseDeltaVelocity = Vector2.zero;
|
||||
|
||||
|
||||
|
||||
private void Start()
|
||||
{
|
||||
if (isLocalPlayer)
|
||||
{
|
||||
controller = GetComponent<CharacterController>();
|
||||
playerCamera.gameObject.GetComponent<Camera>().enabled = true;
|
||||
|
||||
playerCamera.gameObject.SetActive(true);
|
||||
neckLength = Vector3.Distance(playerNeck.position,playerCamera.position);
|
||||
|
||||
if (lockCursor)
|
||||
@@ -74,6 +72,7 @@ public class PlayerMouseLook : NetworkBehaviour
|
||||
|
||||
|
||||
}
|
||||
|
||||
playerCamera.position = playerNeck.position;
|
||||
playerCamera.position += playerNeck.up * neckLength;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user