Not spawning correctly fix

This commit is contained in:
RochesterX
2025-03-25 11:56:06 -04:00
parent 94bfd6cd9c
commit 867376c7d7
4 changed files with 274 additions and 280 deletions

View File

@@ -49,7 +49,7 @@ public class GameManager : MonoBehaviour
{
foreach (GameObject player in players)
{
player.transform.position = spawnPosition + (players.IndexOf(player) * Vector2.right * offset);
player.transform.position = spawnPosition + (offset * players.IndexOf(player) * Vector2.right);
player.GetComponent<Damageable>().lives = 5;
}
}
@@ -58,8 +58,9 @@ public class GameManager : MonoBehaviour
gameTimer.StartTimer();
foreach (GameObject player in players)
{
player.transform.position = spawnPosition;
player.transform.position = spawnPosition + (offset * players.IndexOf(player) * Vector2.right);
player.GetComponent<Damageable>().lives = 0;
print("spawnder");
}
}
if (gameMode == GameMode.obstacleCourse)

View File

@@ -71,7 +71,7 @@ public class PlayerMovement : MonoBehaviour
private void Update()
{
if (GameManager.Instance.gameOver) maxSpeed = 1f;
if (GameManager.Instance != null && GameManager.Instance.gameOver) maxSpeed = 1f;
if (damageable.dying/* || (GameManager.Instance != null && GameManager.Instance.gameOver)*/) return;
Jump();