dash is working better!
This commit is contained in:
parent
6fda5e48b5
commit
f7d45185fa
File diff suppressed because it is too large
Load Diff
@ -20,12 +20,12 @@ public class PlayerBehavior : MonoBehaviour
|
|||||||
[Header("Clarinet:")]
|
[Header("Clarinet:")]
|
||||||
bool unlockedClarinet;
|
bool unlockedClarinet;
|
||||||
[SerializeField] private float dashMult = 2;
|
[SerializeField] private float dashMult = 2;
|
||||||
[SerializeField] private float maxDashTime = 5.0f;
|
[SerializeField] private float maxDashTime = 2.0f;
|
||||||
[SerializeField] private float dashStopSpeed = 0.01f;
|
[SerializeField] private float dashStopSpeed = 0.01f;
|
||||||
private float currentDashTime;
|
private float currentDashTime;
|
||||||
public bool isDash = false;
|
public bool isDash = false;
|
||||||
public Vector2 moveDirection;
|
public Vector3 moveDirection;
|
||||||
public float dashDistance = 5;
|
public float dashDistance = 0.1f;
|
||||||
|
|
||||||
[Header("Grappling:")]
|
[Header("Grappling:")]
|
||||||
[SerializeField] public Tutorial_GrapplingGun grapplingGun;
|
[SerializeField] public Tutorial_GrapplingGun grapplingGun;
|
||||||
@ -104,17 +104,17 @@ public class PlayerBehavior : MonoBehaviour
|
|||||||
currentDashTime = 0.0f;
|
currentDashTime = 0.0f;
|
||||||
playerInput.DeactivateInput();
|
playerInput.DeactivateInput();
|
||||||
}
|
}
|
||||||
if (!playerController.IsGrounded() && (currentDashTime < maxDashTime))
|
if (!playerController.IsGrounded() && (currentDashTime < maxDashTime) && isDash)
|
||||||
{
|
{
|
||||||
if(forward == 1)
|
if(forward == 1)
|
||||||
{
|
{
|
||||||
moveDirection = transform.right * dashDistance;
|
moveDirection = new Vector3(1f,-1f,0f) * dashDistance;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
moveDirection = -(transform.right) * dashDistance;
|
moveDirection = new Vector3(-1f,-1f,0f) * dashDistance;
|
||||||
}
|
}
|
||||||
//_rb.AddForce(dashSpeed, ForceMode2D.Force);
|
transform.position = transform.position + moveDirection;
|
||||||
currentDashTime += dashStopSpeed;
|
currentDashTime += dashStopSpeed;
|
||||||
print("cdt " + currentDashTime);
|
print("cdt " + currentDashTime);
|
||||||
}
|
}
|
||||||
|
@ -110,240 +110,224 @@ public class PlayerMovement : MonoBehaviour
|
|||||||
|
|
||||||
private void Update()
|
private void Update()
|
||||||
{
|
{
|
||||||
isDashing = playerBehavior.isDash;
|
unlockedTrumpet = stateController.unlockedTrumpet;
|
||||||
if(isDashing)
|
#region TIMERS
|
||||||
|
LastOnGroundTime -= Time.deltaTime;
|
||||||
|
LastOnWallTime -= Time.deltaTime;
|
||||||
|
LastOnWallRightTime -= Time.deltaTime;
|
||||||
|
LastOnWallLeftTime -= Time.deltaTime;
|
||||||
|
|
||||||
|
LastPressedJumpTime -= Time.deltaTime;
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region INPUT HANDLER
|
||||||
|
|
||||||
|
if (_moveInput.x != 0)
|
||||||
|
CheckDirectionToFace(_moveInput.x > 0);
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
// if (!IsJumping)
|
||||||
|
// {
|
||||||
|
// print("not jumping");
|
||||||
|
// }
|
||||||
|
// else
|
||||||
|
// {
|
||||||
|
// print("jumping, " + RB.velocity.y);
|
||||||
|
// }
|
||||||
|
|
||||||
|
#region COLLISION CHECKS
|
||||||
|
if (!IsJumping)
|
||||||
{
|
{
|
||||||
FreezeControl();
|
//Ground Check
|
||||||
}
|
if (IsGrounded()) //checks if set box overlaps with ground
|
||||||
else{
|
|
||||||
|
|
||||||
if(isFrozen)
|
|
||||||
{
|
{
|
||||||
Data.gravityStrength = tempGrav;
|
LastOnGroundTime = Data.coyoteTime; //if so sets the lastGrounded to coyoteTime
|
||||||
Data.fallGravityMult = tempFall;
|
if (unlockedTrumpet) {
|
||||||
isFrozen = false;
|
trumpet = 2;
|
||||||
}
|
gameUI.ToggleTrumpet(true);
|
||||||
|
} else {
|
||||||
unlockedTrumpet = stateController.unlockedTrumpet;
|
trumpet = -1;
|
||||||
#region TIMERS
|
}
|
||||||
LastOnGroundTime -= Time.deltaTime;
|
wasGrappling = false;
|
||||||
LastOnWallTime -= Time.deltaTime;
|
isRegFalling = false;
|
||||||
LastOnWallRightTime -= Time.deltaTime;
|
} else {
|
||||||
LastOnWallLeftTime -= Time.deltaTime;
|
// print("not jumping");
|
||||||
|
if(!_isJumpFalling && !isRegFalling) {
|
||||||
LastPressedJumpTime -= Time.deltaTime;
|
if(unlockedTrumpet) {
|
||||||
#endregion
|
trumpet = 1;
|
||||||
|
|
||||||
#region INPUT HANDLER
|
|
||||||
|
|
||||||
if (_moveInput.x != 0)
|
|
||||||
CheckDirectionToFace(_moveInput.x > 0);
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
// if (!IsJumping)
|
|
||||||
// {
|
|
||||||
// print("not jumping");
|
|
||||||
// }
|
|
||||||
// else
|
|
||||||
// {
|
|
||||||
// print("jumping, " + RB.velocity.y);
|
|
||||||
// }
|
|
||||||
|
|
||||||
#region COLLISION CHECKS
|
|
||||||
if (!IsJumping)
|
|
||||||
{
|
|
||||||
//Ground Check
|
|
||||||
if (IsGrounded()) //checks if set box overlaps with ground
|
|
||||||
{
|
|
||||||
LastOnGroundTime = Data.coyoteTime; //if so sets the lastGrounded to coyoteTime
|
|
||||||
if (unlockedTrumpet) {
|
|
||||||
trumpet = 2;
|
|
||||||
gameUI.ToggleTrumpet(true);
|
gameUI.ToggleTrumpet(true);
|
||||||
} else {
|
} else {
|
||||||
trumpet = -1;
|
trumpet = -1;
|
||||||
}
|
}
|
||||||
wasGrappling = false;
|
isRegFalling = true;
|
||||||
isRegFalling = false;
|
|
||||||
} else {
|
|
||||||
// print("not jumping");
|
|
||||||
if(!_isJumpFalling && !isRegFalling) {
|
|
||||||
if(unlockedTrumpet) {
|
|
||||||
trumpet = 1;
|
|
||||||
gameUI.ToggleTrumpet(true);
|
|
||||||
} else {
|
|
||||||
trumpet = -1;
|
|
||||||
}
|
|
||||||
isRegFalling = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//Right Wall Check
|
|
||||||
if (((Physics2D.OverlapBox(this.transform.position, _wallCheckSize, 0, _groundLayer) && IsFacingRight)
|
|
||||||
|| (Physics2D.OverlapBox(this.transform.position, _wallCheckSize, 0, _groundLayer) && !IsFacingRight)) && !IsWallJumping)
|
|
||||||
LastOnWallRightTime = Data.coyoteTime;
|
|
||||||
|
|
||||||
//Right Wall Check
|
|
||||||
if (((Physics2D.OverlapBox(this.transform.position, _wallCheckSize, 0, _groundLayer) && !IsFacingRight)
|
|
||||||
|| (Physics2D.OverlapBox(this.transform.position, _wallCheckSize, 0, _groundLayer) && IsFacingRight)) && !IsWallJumping)
|
|
||||||
LastOnWallLeftTime = Data.coyoteTime;
|
|
||||||
|
|
||||||
//Two checks needed for both left and right walls since whenever the play turns the wall checkPoints swap sides
|
|
||||||
LastOnWallTime = Mathf.Max(LastOnWallLeftTime, LastOnWallRightTime);
|
|
||||||
}
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
#region JUMP CHECKS
|
|
||||||
if (IsJumping && RB.velocity.y <= 0)
|
|
||||||
{
|
|
||||||
IsJumping = false;
|
|
||||||
// print("isJumping " + IsJumping);
|
|
||||||
|
|
||||||
if (!IsWallJumping)
|
|
||||||
_isJumpFalling = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (IsWallJumping && Time.time - _wallJumpStartTime > Data.wallJumpTime)
|
|
||||||
{
|
|
||||||
IsWallJumping = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (LastOnGroundTime > 0 && !IsJumping && !IsWallJumping)
|
|
||||||
{
|
|
||||||
_isJumpCut = false;
|
|
||||||
|
|
||||||
if (!IsJumping)
|
|
||||||
_isJumpFalling = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
//Jump
|
|
||||||
if (CanJump() && LastPressedJumpTime > 0)
|
|
||||||
{
|
|
||||||
IsJumping = true;
|
|
||||||
IsWallJumping = false;
|
|
||||||
_isJumpCut = false;
|
|
||||||
_isJumpFalling = false;
|
|
||||||
Jump();
|
|
||||||
|
|
||||||
if (!IsGrounded() && in_range && trumpet > 0)
|
|
||||||
{
|
|
||||||
gameObject.transform.Find("Trumpet").GetComponent<AudioSource>().Play();
|
|
||||||
enemy.GetComponent<EnemyPatrol>().DefeatEnemy();
|
|
||||||
enemy = null;
|
|
||||||
in_range = false;
|
|
||||||
}
|
|
||||||
else if (!IsGrounded() && !in_range && trumpet > 0)
|
|
||||||
{
|
|
||||||
trumpet -= 1;
|
|
||||||
}
|
|
||||||
// check if double jump, play sound
|
|
||||||
if (trumpet == 0) {
|
|
||||||
gameObject.transform.Find("Trumpet").GetComponent<AudioSource>().Play();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// stop sound if needed
|
//Right Wall Check
|
||||||
if (soundPlaying && (isRegFalling || IsJumping || _isJumpFalling)) {
|
if (((Physics2D.OverlapBox(this.transform.position, _wallCheckSize, 0, _groundLayer) && IsFacingRight)
|
||||||
print("footsteps stop");
|
|| (Physics2D.OverlapBox(this.transform.position, _wallCheckSize, 0, _groundLayer) && !IsFacingRight)) && !IsWallJumping)
|
||||||
audioSource.Stop();
|
LastOnWallRightTime = Data.coyoteTime;
|
||||||
soundPlaying = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
//WALL JUMP
|
//Right Wall Check
|
||||||
// else if (CanWallJump() && LastPressedJumpTime > 0)
|
if (((Physics2D.OverlapBox(this.transform.position, _wallCheckSize, 0, _groundLayer) && !IsFacingRight)
|
||||||
// {
|
|| (Physics2D.OverlapBox(this.transform.position, _wallCheckSize, 0, _groundLayer) && IsFacingRight)) && !IsWallJumping)
|
||||||
// IsWallJumping = true;
|
LastOnWallLeftTime = Data.coyoteTime;
|
||||||
// IsJumping = false;
|
|
||||||
// _isJumpCut = false;
|
|
||||||
// _isJumpFalling = false;
|
|
||||||
// _wallJumpStartTime = Time.time;
|
|
||||||
// _lastWallJumpDir = (LastOnWallRightTime > 0) ? -1 : 1;
|
|
||||||
//
|
|
||||||
// WallJump(_lastWallJumpDir);
|
|
||||||
// }
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
#region GRAPPLE CHECKS
|
//Two checks needed for both left and right walls since whenever the play turns the wall checkPoints swap sides
|
||||||
// set wasGrappling to true if the player starts grappling
|
LastOnWallTime = Mathf.Max(LastOnWallLeftTime, LastOnWallRightTime);
|
||||||
if (grapplingRope.isGrappling) {
|
|
||||||
wasGrappling = true;
|
|
||||||
}
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
|
|
||||||
#region SLIDE CHECKS
|
|
||||||
if (CanSlide() && ((LastOnWallLeftTime > 0 && _moveInput.x < 0) || (LastOnWallRightTime > 0 && _moveInput.x > 0)))
|
|
||||||
IsSliding = true;
|
|
||||||
else
|
|
||||||
IsSliding = false;
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
#region GRAVITY
|
|
||||||
//Higher gravity if we've released the jump input or are falling
|
|
||||||
if (IsSliding)
|
|
||||||
{
|
|
||||||
SetGravityScale(0);
|
|
||||||
}
|
|
||||||
else if (RB.velocity.y < 0 && _moveInput.y < 0)
|
|
||||||
{
|
|
||||||
//Much higher gravity if holding down
|
|
||||||
SetGravityScale(Data.gravityScale * Data.fastFallGravityMult);
|
|
||||||
//Caps maximum fall speed, so when falling over large distances we don't accelerate to insanely high speeds
|
|
||||||
RB.velocity = new Vector2(RB.velocity.x, Mathf.Max(RB.velocity.y, -Data.maxFastFallSpeed));
|
|
||||||
}
|
|
||||||
else if (_isJumpCut)
|
|
||||||
{
|
|
||||||
//Higher gravity if jump button released
|
|
||||||
SetGravityScale(Data.gravityScale * Data.jumpCutGravityMult);
|
|
||||||
RB.velocity = new Vector2(RB.velocity.x, Mathf.Max(RB.velocity.y, -Data.maxFallSpeed));
|
|
||||||
}
|
|
||||||
else if ((IsJumping || IsWallJumping || _isJumpFalling) && Mathf.Abs(RB.velocity.y) < Data.jumpHangTimeThreshold)
|
|
||||||
{
|
|
||||||
SetGravityScale(Data.gravityScale * Data.jumpHangGravityMult);
|
|
||||||
}
|
|
||||||
else if (RB.velocity.y < 0)
|
|
||||||
{
|
|
||||||
//Higher gravity if falling
|
|
||||||
SetGravityScale(Data.gravityScale * Data.fallGravityMult);
|
|
||||||
//Caps maximum fall speed, so when falling over large distances we don't accelerate to insanely high speeds
|
|
||||||
RB.velocity = new Vector2(RB.velocity.x, Mathf.Max(RB.velocity.y, -Data.maxFallSpeed));
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
//Default gravity if standing on a platform or moving upwards
|
|
||||||
SetGravityScale(Data.gravityScale);
|
|
||||||
}
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
#region SOUND CHECKS
|
|
||||||
if (!IsJumping && !_isJumpFalling && !isRegFalling && _moveInput.x != 0) {
|
|
||||||
if (!soundPlaying) {
|
|
||||||
// print("footsteps PLAY");
|
|
||||||
audioSource.Play();
|
|
||||||
soundPlaying = true;
|
|
||||||
}
|
|
||||||
} else if (soundPlaying && audioSource.clip.name == "footsteps") {
|
|
||||||
// print("footsteps stop");
|
|
||||||
audioSource.Stop();
|
|
||||||
soundPlaying = false;
|
|
||||||
}
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
#region UPDATE UI
|
|
||||||
if (trumpet == 0) {
|
|
||||||
gameUI.ToggleTrumpet(false);
|
|
||||||
}
|
|
||||||
/*if (isDashing)
|
|
||||||
{
|
|
||||||
gameUI.ToggleClarinet(false);
|
|
||||||
print("toggle clarinet false?");
|
|
||||||
}*/
|
|
||||||
#endregion
|
|
||||||
}
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region JUMP CHECKS
|
||||||
|
if (IsJumping && RB.velocity.y <= 0)
|
||||||
|
{
|
||||||
|
IsJumping = false;
|
||||||
|
// print("isJumping " + IsJumping);
|
||||||
|
|
||||||
|
if (!IsWallJumping)
|
||||||
|
_isJumpFalling = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (IsWallJumping && Time.time - _wallJumpStartTime > Data.wallJumpTime)
|
||||||
|
{
|
||||||
|
IsWallJumping = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (LastOnGroundTime > 0 && !IsJumping && !IsWallJumping)
|
||||||
|
{
|
||||||
|
_isJumpCut = false;
|
||||||
|
|
||||||
|
if (!IsJumping)
|
||||||
|
_isJumpFalling = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
//Jump
|
||||||
|
if (CanJump() && LastPressedJumpTime > 0)
|
||||||
|
{
|
||||||
|
IsJumping = true;
|
||||||
|
IsWallJumping = false;
|
||||||
|
_isJumpCut = false;
|
||||||
|
_isJumpFalling = false;
|
||||||
|
Jump();
|
||||||
|
|
||||||
|
if (!IsGrounded() && in_range && trumpet > 0)
|
||||||
|
{
|
||||||
|
gameObject.transform.Find("Trumpet").GetComponent<AudioSource>().Play();
|
||||||
|
enemy.GetComponent<EnemyPatrol>().DefeatEnemy();
|
||||||
|
enemy = null;
|
||||||
|
in_range = false;
|
||||||
|
}
|
||||||
|
else if (!IsGrounded() && !in_range && trumpet > 0)
|
||||||
|
{
|
||||||
|
trumpet -= 1;
|
||||||
|
}
|
||||||
|
// check if double jump, play sound
|
||||||
|
if (trumpet == 0) {
|
||||||
|
gameObject.transform.Find("Trumpet").GetComponent<AudioSource>().Play();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// stop sound if needed
|
||||||
|
if (soundPlaying && (isRegFalling || IsJumping || _isJumpFalling)) {
|
||||||
|
print("footsteps stop");
|
||||||
|
audioSource.Stop();
|
||||||
|
soundPlaying = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
//WALL JUMP
|
||||||
|
// else if (CanWallJump() && LastPressedJumpTime > 0)
|
||||||
|
// {
|
||||||
|
// IsWallJumping = true;
|
||||||
|
// IsJumping = false;
|
||||||
|
// _isJumpCut = false;
|
||||||
|
// _isJumpFalling = false;
|
||||||
|
// _wallJumpStartTime = Time.time;
|
||||||
|
// _lastWallJumpDir = (LastOnWallRightTime > 0) ? -1 : 1;
|
||||||
|
//
|
||||||
|
// WallJump(_lastWallJumpDir);
|
||||||
|
// }
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region GRAPPLE CHECKS
|
||||||
|
// set wasGrappling to true if the player starts grappling
|
||||||
|
if (grapplingRope.isGrappling) {
|
||||||
|
wasGrappling = true;
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
|
#region SLIDE CHECKS
|
||||||
|
if (CanSlide() && ((LastOnWallLeftTime > 0 && _moveInput.x < 0) || (LastOnWallRightTime > 0 && _moveInput.x > 0)))
|
||||||
|
IsSliding = true;
|
||||||
|
else
|
||||||
|
IsSliding = false;
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region GRAVITY
|
||||||
|
//Higher gravity if we've released the jump input or are falling
|
||||||
|
if (IsSliding)
|
||||||
|
{
|
||||||
|
SetGravityScale(0);
|
||||||
|
}
|
||||||
|
else if (RB.velocity.y < 0 && _moveInput.y < 0)
|
||||||
|
{
|
||||||
|
//Much higher gravity if holding down
|
||||||
|
SetGravityScale(Data.gravityScale * Data.fastFallGravityMult);
|
||||||
|
//Caps maximum fall speed, so when falling over large distances we don't accelerate to insanely high speeds
|
||||||
|
RB.velocity = new Vector2(RB.velocity.x, Mathf.Max(RB.velocity.y, -Data.maxFastFallSpeed));
|
||||||
|
}
|
||||||
|
else if (_isJumpCut)
|
||||||
|
{
|
||||||
|
//Higher gravity if jump button released
|
||||||
|
SetGravityScale(Data.gravityScale * Data.jumpCutGravityMult);
|
||||||
|
RB.velocity = new Vector2(RB.velocity.x, Mathf.Max(RB.velocity.y, -Data.maxFallSpeed));
|
||||||
|
}
|
||||||
|
else if ((IsJumping || IsWallJumping || _isJumpFalling) && Mathf.Abs(RB.velocity.y) < Data.jumpHangTimeThreshold)
|
||||||
|
{
|
||||||
|
SetGravityScale(Data.gravityScale * Data.jumpHangGravityMult);
|
||||||
|
}
|
||||||
|
else if (RB.velocity.y < 0)
|
||||||
|
{
|
||||||
|
//Higher gravity if falling
|
||||||
|
SetGravityScale(Data.gravityScale * Data.fallGravityMult);
|
||||||
|
//Caps maximum fall speed, so when falling over large distances we don't accelerate to insanely high speeds
|
||||||
|
RB.velocity = new Vector2(RB.velocity.x, Mathf.Max(RB.velocity.y, -Data.maxFallSpeed));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
//Default gravity if standing on a platform or moving upwards
|
||||||
|
SetGravityScale(Data.gravityScale);
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region SOUND CHECKS
|
||||||
|
if (!IsJumping && !_isJumpFalling && !isRegFalling && _moveInput.x != 0) {
|
||||||
|
if (!soundPlaying) {
|
||||||
|
// print("footsteps PLAY");
|
||||||
|
audioSource.Play();
|
||||||
|
soundPlaying = true;
|
||||||
|
}
|
||||||
|
} else if (soundPlaying && audioSource.clip.name == "footsteps") {
|
||||||
|
// print("footsteps stop");
|
||||||
|
audioSource.Stop();
|
||||||
|
soundPlaying = false;
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region UPDATE UI
|
||||||
|
if (trumpet == 0) {
|
||||||
|
gameUI.ToggleTrumpet(false);
|
||||||
|
}
|
||||||
|
/*if (isDashing)
|
||||||
|
{
|
||||||
|
gameUI.ToggleClarinet(false);
|
||||||
|
print("toggle clarinet false?");
|
||||||
|
}*/
|
||||||
|
#endregion
|
||||||
}
|
}
|
||||||
|
|
||||||
private void FixedUpdate()
|
private void FixedUpdate()
|
||||||
{
|
{
|
||||||
if(!isDashing){
|
|
||||||
//Handle Run
|
//Handle Run
|
||||||
if (IsWallJumping)
|
if (IsWallJumping)
|
||||||
Run(Data.wallJumpRunLerp);
|
Run(Data.wallJumpRunLerp);
|
||||||
@ -353,21 +337,6 @@ public class PlayerMovement : MonoBehaviour
|
|||||||
//Handle Slide
|
//Handle Slide
|
||||||
if (IsSliding)
|
if (IsSliding)
|
||||||
Slide();
|
Slide();
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void FreezeControl()
|
|
||||||
{
|
|
||||||
if(!isFrozen)
|
|
||||||
{
|
|
||||||
tempGrav = Data.gravityStrength;
|
|
||||||
tempFall = Data.fallGravityMult;
|
|
||||||
}
|
|
||||||
|
|
||||||
Data.gravityStrength = 0;
|
|
||||||
Data.fallGravityMult = 0;
|
|
||||||
|
|
||||||
isFrozen = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#region INPUT CALLBACKS
|
#region INPUT CALLBACKS
|
||||||
|
Loading…
Reference in New Issue
Block a user