slide no longer rotates player

this means that currently the model doesn't rotate but that will be
rectified once we have the animations
This commit is contained in:
Melbyj1125
2022-02-23 00:00:43 -06:00
parent 5b18d2845c
commit 65a7008d24
18 changed files with 134 additions and 105 deletions

View File

@@ -60,9 +60,6 @@ public class MoveStateManager : NetworkBehaviour
public Vector3 driftVel; // Lerped Movement Vector
public float calculatedCurVel; // calculated current vel using driftVel
//Slide Variables
public Vector3 slideUp; // Slide upwards direction
//Camera Variables
private Vector3 camRotation; // cameras camera rotation vector
[Range(-45, -15)]
@@ -103,8 +100,6 @@ public class MoveStateManager : NetworkBehaviour
previousState = IdleState;
currentState.EnterState(this, previousState);
//Slide Upwards Variable
slideUp = GetComponentInParent<Transform>().up; // get parents up direction
distToGround = GetComponent<Collider>().bounds.extents.y; // set players distance to ground
if (!IsLocalPlayer) { return; }
@@ -220,6 +215,11 @@ public class MoveStateManager : NetworkBehaviour
Vector3 moveXZ = new Vector3(vel.x, 0, vel.z);
driftVel = Vector3.Lerp(driftVel, moveXZ, pStats.Traction * Time.deltaTime);
//Need to have movecontroller involved for correct movement
if(currentState == CrouchState){
driftVel = Vector3.zero;
}
//Actually move he player
moveController.Move(driftVel);
}