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

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

View File

@@ -58,6 +58,7 @@ public class dAerialStateManager : 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
@@ -244,6 +245,14 @@ public class dAerialStateManager : 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
@@ -514,7 +523,7 @@ public class dAerialStateManager : NetworkBehaviour
public void GrappleReleaseForce(){
if(release){
currentForcePower *= .90f;
moveController.Move(postForceDirection * currentForcePower);
moveController.Move(postForceDirection * currentForcePower * Time.deltaTime);
if(currentForcePower < .05) release = false;
}