skyrim is finished mostly

This commit is contained in:
Melbyj1125
2022-04-08 13:21:50 -05:00
parent 04a8caf8bb
commit b097ca6907
5 changed files with 195 additions and 19 deletions

View File

@@ -62,6 +62,7 @@ public class AerialStateManager : NetworkBehaviour
//Ground Check
public bool isGrounded; // is player grounded
public float groundCheckDistance = 0.05f; // offset distance to check ground
public float groundSlantDistance = 0.1f;
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
@@ -271,6 +272,14 @@ public class AerialStateManager : NetworkBehaviour
}
}
}
else if(Physics.Raycast(groundRay, out groundHit, moveController.height + groundSlantDistance) && !jumpPressed){
if(Vector3.Dot(groundHit.normal, transform.up) > 0f){
Debug.Log("On a Slant");
Debug.Log("The grounds Normal" + groundHit.normal);
moveController.Move(groundHit.normal * 20 * Time.deltaTime);
mSM.CancelMomentum();
}
}
}
//Actually applies the downwards movement

View File

@@ -13,7 +13,7 @@ public class AerialGrappleAirState : AerialBaseState
bool pointReached = false;
float initialForcePower = 4;
float initialForcePower = 100;
public override void EnterState(AerialStateManager aSM, AerialBaseState previousState){
@@ -22,7 +22,7 @@ public class AerialGrappleAirState : AerialBaseState
distanceBeneathHook = -3f;
distanceAfterHook = 8f;
pointReached = false;
initialForcePower = 4;
initialForcePower = 100;
//refresh jump number
aSM.curJumpNum = 0;
@@ -83,7 +83,7 @@ public class AerialGrappleAirState : AerialBaseState
//Apply default gravity
if(!pointReached){
aSM.moveController.Move(initialForceDirection * initialForcePower);
aSM.moveController.Move(initialForceDirection * initialForcePower * Time.deltaTime);
aSM.GravityCalculation(0);
aSM.pStats.GravVel = 0;
}