mirror of
https://github.com/Leahnaya/TheKingsRace.git
synced 2026-08-22 02:14:30 -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));
|
||||
}
|
||||
|
||||
@@ -78,7 +78,6 @@ public class MoveStateManager : NetworkBehaviour
|
||||
//Ragdoll Variables
|
||||
public Vector3 dirHit; // Direction hit
|
||||
public float distToGround; // distance to ground
|
||||
public Vector3 prevRot; // previous rotation before ragdolled
|
||||
////
|
||||
|
||||
|
||||
@@ -313,7 +312,7 @@ public class MoveStateManager : NetworkBehaviour
|
||||
//Apply Wind movement to the player
|
||||
public void ApplyWind(bool wind){
|
||||
if(wind){
|
||||
moveController.Move(pStats.WindDirection.normalized * 2);
|
||||
moveController.Move(pStats.WindDirection.normalized * .2f);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user