Fixed a lot of the issues we addressed on Monday

This commit is contained in:
Melbyj1125
2022-03-09 02:16:56 -06:00
parent 03a96b8c67
commit 7ae4b643a1
31 changed files with 161 additions and 222 deletions

View File

@@ -7,11 +7,12 @@ public class MoveRagdollState : MoveBaseState
float ragTime; // ragdoll timer
bool beginRagTimer = false; // whether ragtimer has started
Vector3 prevRot;
public override void EnterState(MoveStateManager mSM, MoveBaseState previousState){
ragTime = mSM.pStats.RecovTime; // how long to be ragdolled
mSM.prevRot = mSM.transform.localEulerAngles; // save previous rotation
prevRot = mSM.transform.localEulerAngles; // save previous rotation
mSM.capCol.enabled = true; // enable capsule collider
mSM.moveController.enabled = false; // disable move controller
mSM.rB.isKinematic = false; // disable kinematic
@@ -22,6 +23,7 @@ public class MoveRagdollState : MoveBaseState
}
public override void ExitState(MoveStateManager mSM, MoveBaseState nextState){
mSM.transform.localEulerAngles = prevRot; // reset player rotation
}

View File

@@ -12,7 +12,6 @@ public class MoveRecoveringState : MoveBaseState
mSM.moveController.enabled = true; // enable move controller
mSM.rB.isKinematic = true; // enable kinematic
mSM.rB.detectCollisions = false; // detect collisions false
mSM.transform.localEulerAngles = mSM.prevRot; // reset player rotation
mSM.CancelMomentum(); // reset player variables
mSM.moveController.Move(new Vector3(0,2,0));
}