small adjustment to nitro and player prefabs

This commit is contained in:
Melbyj1125 2022-01-28 13:45:38 -06:00
parent 6bab1292f6
commit 9c3462521e
10 changed files with 38 additions and 23 deletions

View File

@ -3545,6 +3545,7 @@ MonoBehaviour:
maxVel: 40
minVel: 20
curVel: 0
hardCapMaxVel: 0
acc: 0.02
jumpPow: 60
jumpNum: 2
@ -3754,14 +3755,14 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
wallMaxDistance: 3
wallSpeedMultiplier: 1.2
wallSpeedMultiplier: 1.5
minimumHeight: 0.1
maxAngleRoll: 20
normalizedAngleThreshold: 0.1
jumpDuration: 0.02
wallBouncing: 3
cameraTransitionDuration: 1
wallGravityDownForce: 3
wallGravityDownForce: 2.8
--- !u!114 &2761631967499966007
MonoBehaviour:
m_ObjectHideFlags: 0

View File

@ -301,6 +301,7 @@ MonoBehaviour:
maxVel: 40
minVel: 15
curVel: 0
hardCapMaxVel: 60
acc: 0.01
jumpPow: 60
jumpNum: 2
@ -510,14 +511,14 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
wallMaxDistance: 1
wallSpeedMultiplier: 1.2
wallSpeedMultiplier: 1.5
minimumHeight: 0.1
maxAngleRoll: 20
normalizedAngleThreshold: 0.1
jumpDuration: 0.02
wallBouncing: 3
cameraTransitionDuration: 1
wallGravityDownForce: 3
wallGravityDownForce: 2.8
--- !u!120 &384692328
LineRenderer:
m_ObjectHideFlags: 0

View File

@ -261,6 +261,7 @@ MonoBehaviour:
maxVel: 40
minVel: 20
curVel: 0
hardCapMaxVel: 0
acc: 0.01
jumpPow: 60
jumpNum: 2
@ -470,14 +471,14 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
wallMaxDistance: 3
wallSpeedMultiplier: 1.2
wallSpeedMultiplier: 1.5
minimumHeight: 0.1
maxAngleRoll: 20
normalizedAngleThreshold: 0.1
jumpDuration: 0.02
wallBouncing: 3
cameraTransitionDuration: 1
wallGravityDownForce: 3
wallGravityDownForce: 2.8
--- !u!114 &8545598182256100239
MonoBehaviour:
m_ObjectHideFlags: 0

View File

@ -191,7 +191,7 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
wallMaxDistance: 3
wallSpeedMultiplier: 1.2
wallSpeedMultiplier: 1.5
minimumHeight: 0.1
maxAngleRoll: 20
normalizedAngleThreshold: 0.1

View File

@ -7,6 +7,7 @@ public class dNitro : MonoBehaviour
private PlayerStats playerStats;
private CoolDown driver;
private bool isOnCoolDown = false;
private bool isNitroing = false;
//this will need to be set from scritable object or something;
private float coolDown;
@ -22,7 +23,13 @@ public class dNitro : MonoBehaviour
//once cooldowns are implemented, put this on one (a long one)
if (Input.GetKeyDown(KeyCode.LeftShift) && isOnCoolDown == false && playerStats.HasNitro)
{
playerStats.CurVel = playerStats.MaxVel;
if(playerStats.CurVel < playerStats.HardCapMaxVel){
playerStats.CurVel += playerStats.Acc * 10;
}
else if(playerStats.CurVel > playerStats.HardCapMaxVel){
playerStats.CurVel = playerStats.HardCapMaxVel;
}
StartCoroutine(startCoolDown());
}
}

View File

@ -18,7 +18,7 @@ public class dWallRun : NetworkBehaviour
public float wallBouncing = 3;
public float cameraTransitionDuration = 1;
public float wallGravityDownForce = 5f;
public float wallGravityDownForce = 2.8f;
[Space]
dPlayerMovement playerMovementController;

View File

@ -254,10 +254,15 @@ public class dPlayerMovement : NetworkBehaviour
return pStats.CurVel;
}
//If the players speed is above or equal to max speed set speed to max
else
else if (pStats.CurVel >= pStats.MaxVel)
{
pStats.CurVel = pStats.MaxVel;
return pStats.CurVel;
}
else{
Debug.Log("Something has gone wrong with the PlayerSpeed()");
return -1;
}
}
@ -286,7 +291,7 @@ public class dPlayerMovement : NetworkBehaviour
if (Input.GetAxis("Jump") != 0 && !jumpHeld && curJumpNum < pStats.JumpNum && !isSliding)
{
if(wallRun.IsWallRunning()){
AddImpact((wallRun.GetWallJumpDirection()), pStats.JumpPow * 8f);
AddImpact((wallRun.GetWallJumpDirection()), pStats.JumpPow * 8.5f);
g = pStats.JumpPow;
curJumpNum = 0;
}
@ -432,7 +437,7 @@ public class dPlayerMovement : NetworkBehaviour
//if wallrunning apply different gravity
if(wallRun.IsWallRunning()){
GravityCalculation(4);
GravityCalculation(2);
}
//Normal gravity if not wallrunning
@ -504,6 +509,7 @@ public class dPlayerMovement : NetworkBehaviour
//Ragdoll Functions
public void GetHit(Vector3 dir, float force){
//if (!IsLocalPlayer) { return; }
if(firstHit == false){
EnableRagdoll();
dir.Normalize();

View File

@ -18,7 +18,7 @@ public class WallRun : NetworkBehaviour
public float wallBouncing = 3;
public float cameraTransitionDuration = 1;
public float wallGravityDownForce = 5f;
public float wallGravityDownForce = 2.8f;
[Space]
PlayerMovement playerMovementController;

View File

@ -286,7 +286,7 @@ public class PlayerMovement : NetworkBehaviour
if (Input.GetAxis("Jump") != 0 && !jumpHeld && curJumpNum < pStats.JumpNum && !isSliding)
{
if(wallRun.IsWallRunning()){
AddImpact((wallRun.GetWallJumpDirection()), pStats.JumpPow * 8f);
AddImpact((wallRun.GetWallJumpDirection()), pStats.JumpPow * 8.5f);
g = pStats.JumpPow;
}
@ -390,7 +390,6 @@ public class PlayerMovement : NetworkBehaviour
}
//REMOVE WHEN UNNECCESARY
//Respawns player if they fall below a certain point
private void Respawn()
@ -409,7 +408,7 @@ public class PlayerMovement : NetworkBehaviour
//Gliding
if(pStats.HasGlider && g < 0 && Input.GetButton("Jump")){
//Gravity with glider
GravityCalculation(6);
GravityCalculation(8);
//Set temp values to put traction back to normal
if(tempSet == false){
@ -431,7 +430,7 @@ public class PlayerMovement : NetworkBehaviour
//if wallrunning apply different gravity
if(wallRun.IsWallRunning()){
GravityCalculation(4);
GravityCalculation(2);
}
//Normal gravity if not wallrunning

View File

@ -6,14 +6,14 @@ using UnityEngine.Assertions;
public class PlayerStats : MonoBehaviour
{
//Soft cap max speed a player can achieve they can achieve this speed by running
[SerializeField] private float maxVel = 30.0f;
[SerializeField] private float maxVel = 40.0f;
public float MaxVel{
get{ return maxVel; }
set{ maxVel = value; }
}
//Minimum possible player speed
[SerializeField] private float minVel = 5.0f;
[SerializeField] private float minVel = 15.0f;
public float MinVel{
get{ return minVel; }
set{ minVel = value; }
@ -27,21 +27,21 @@ public class PlayerStats : MonoBehaviour
}
//The absolute max speed a player can achieve through boosts or momentum increases will disipate down to soft cap
[SerializeField] private float hardCapMaxVel;
[SerializeField] private float hardCapMaxVel = 60.0f;
public float HardCapMaxVel{
get{ return hardCapMaxVel; }
set{ hardCapMaxVel = value; }
}
//Player Acceleration
[SerializeField] private float acc = 0.1f;
[SerializeField] private float acc = 0.01f;
public float Acc{
get{ return acc; }
set{ acc = value; }
}
//Player Jump power
[SerializeField] private float jumpPow = 63.0f;
[SerializeField] private float jumpPow = 60.0f;
public float JumpPow{
get{ return jumpPow; }
set{ jumpPow = value; }
@ -62,7 +62,7 @@ public class PlayerStats : MonoBehaviour
}
//Player Kick Power
[SerializeField] private float kickPow = 150.0f;
[SerializeField] private float kickPow = 500.0f;
public float KickPow{
get{ return kickPow; }
set{ kickPow = value; }