mirror of
https://github.com/Leahnaya/TheKingsRace.git
synced 2026-08-21 09:54:28 -05:00
Fixed a lot of the issues we addressed on Monday
This commit is contained in:
@@ -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
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -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));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user