Small adjustment to skyrim

This commit is contained in:
Melbyj1125
2022-04-11 12:07:27 -05:00
parent 0a65febafe
commit a3a54af3c7
2 changed files with 2 additions and 12 deletions

View File

@@ -58,7 +58,7 @@ public class dAerialStateManager : NetworkBehaviour
//Ground Check
public bool isGrounded; // is player grounded
public float groundCheckDistance = 0.05f; // offset distance to check ground
private float groundSlantDistance = .1f;
private float groundSlantDistance = .05f;
const float jumpGroundingPreventionTime = 0.2f; // delay so player doesn't get snapped to ground while jumping
const float groundCheckDistanceInAir = 0.07f; // How close we have to get to ground to start checking for grounded again
Ray groundRay; // ground ray
@@ -256,35 +256,30 @@ public class dAerialStateManager : NetworkBehaviour
}
}
else if(Physics.Raycast(groundRay, out groundHit, moveController.height + groundSlantDistance) && !jumpPressed && curCoyJumpTimer <= 0){
Debug.Log(groundHit.distance);
if(Vector3.Dot(groundHit.normal, transform.up) <= .8f){
moveController.Move(groundHit.normal * 20 * Time.deltaTime);
mSM.CancelMomentum();
}
}
else if(Physics.Raycast(angleRayLeft, out groundHit, moveController.height + groundSlantDistance) && !jumpPressed && curCoyJumpTimer <= 0){
Debug.Log(groundHit.distance);
if(Vector3.Dot(groundHit.normal, transform.up) <= .8f){
moveController.Move(groundHit.normal * 20 * Time.deltaTime);
mSM.CancelMomentum();
}
}
else if(Physics.Raycast(angleRayRight, out groundHit, moveController.height + groundSlantDistance) && !jumpPressed && curCoyJumpTimer <= 0){
Debug.Log(groundHit.distance);
if(Vector3.Dot(groundHit.normal, transform.up) <= .8f){
moveController.Move(groundHit.normal * 20 * Time.deltaTime);
mSM.CancelMomentum();
}
}
else if(Physics.Raycast(angleRayForward, out groundHit, moveController.height + groundSlantDistance) && !jumpPressed && curCoyJumpTimer <= 0){
Debug.Log(groundHit.distance);
if(Vector3.Dot(groundHit.normal, transform.up) <= .8f){
moveController.Move(groundHit.normal * 20 * Time.deltaTime);
mSM.CancelMomentum();
}
}
else if(Physics.Raycast(angleRayBackwards, out groundHit, moveController.height + groundSlantDistance) && !jumpPressed && curCoyJumpTimer <= 0){
Debug.Log(groundHit.distance);
if(Vector3.Dot(groundHit.normal, transform.up) <= .8f){
moveController.Move(groundHit.normal * 20 * Time.deltaTime);
mSM.CancelMomentum();