weather wheel and weather adjustments

This commit is contained in:
Melbyj1125
2022-02-28 13:42:51 -06:00
parent 46dff8f663
commit 5b6b4a2cb9
12 changed files with 194 additions and 229 deletions

View File

@@ -114,6 +114,8 @@ public class MoveStateManager : NetworkBehaviour
if (!IsLocalPlayer) { return; }
Cursor.lockState = CursorLockMode.Locked; // Lock cursor on start if you are the local player
pStats.CurTraction = pStats.Traction;
pStats.CurAcc = pStats.Acc;
}
// Update is called once per frame
@@ -178,7 +180,7 @@ public class MoveStateManager : NetworkBehaviour
// while the speed is below max speed slowly increase it
else if ((pStats.CurVel >= pStats.MinVel) && (pStats.CurVel < pStats.MaxVel))
{
pStats.CurVel += pStats.Acc;
pStats.CurVel += pStats.CurAcc;
return pStats.CurVel;
}
//If the players speed is above or equal to max speed set speed to max
@@ -219,7 +221,7 @@ public class MoveStateManager : NetworkBehaviour
Debug.DrawRay(gameObject.transform.position + new Vector3(0,.4f,0) + rayOffset, moveXZ.normalized * 1f, Color.red);
Debug.DrawRay(gameObject.transform.position + new Vector3(0,2.2f,0) + rayOffset, moveXZ.normalized * 1f, Color.red);
driftVel = Vector3.Lerp(driftVel, moveXZ, pStats.Traction * Time.deltaTime);
driftVel = Vector3.Lerp(driftVel, moveXZ, pStats.CurTraction * Time.deltaTime);
if(currentState == GrappleAirState){
driftVel = Vector3.zero;
}
@@ -238,7 +240,7 @@ public class MoveStateManager : NetworkBehaviour
//player vector should be under the circumstances
vel = moveX + moveZ;
Vector3 moveXZ = new Vector3(vel.x, 0, vel.z);
driftVel = Vector3.Lerp(driftVel, moveXZ, pStats.Traction * Time.deltaTime);
driftVel = Vector3.Lerp(driftVel, moveXZ, pStats.CurTraction * Time.deltaTime);
//Need to have movecontroller involved for correct movement
if(currentState == CrouchState){