mirror of
https://github.com/Leahnaya/TheKingsRace.git
synced 2026-09-08 18:35:18 -05:00
Updates to terrain sculpting
-Updated Terrains for plains, valley -Added respawn mechanic -Added PlayerMovement respawn support
This commit is contained in:
@@ -192,8 +192,6 @@ public class PlayerMovement : NetworkBehaviour
|
||||
moveController.Move(driftVel);
|
||||
}
|
||||
|
||||
|
||||
|
||||
//Calculates speed current player needs to be going
|
||||
public float PlayerSpeed()
|
||||
{
|
||||
@@ -452,4 +450,24 @@ public class PlayerMovement : NetworkBehaviour
|
||||
}
|
||||
}
|
||||
|
||||
public void CancelMomentum()
|
||||
{
|
||||
pStats.CurVel = 0;
|
||||
vel = Vector3.zero;
|
||||
moveX = Vector3.zero;
|
||||
moveZ = Vector3.zero;
|
||||
moveController.enabled = false;
|
||||
}
|
||||
|
||||
private IEnumerator RespawnTimer()
|
||||
{
|
||||
float duration = 2f;
|
||||
float normalizedTime = 0;
|
||||
while (normalizedTime <= 1f)
|
||||
{
|
||||
normalizedTime += Time.deltaTime / duration;
|
||||
yield return null;
|
||||
}
|
||||
moveController.enabled = true;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user