// If we are in an arena, vehicle drops the bot if they have it, the vehicle spawns at a random spawn point in the arena private void SpawnOnArenaSpawnPoint() { HypeGateTimeBehavior arena = FindObjectOfType <HypeGateTimeBehavior>(); Transform randomSpawnPoint = arena.spawnPoints[Random.Range(0, arena.spawnPoints.Length)]; transform.position = new Vector3(randomSpawnPoint.position.x, randomSpawnPoint.position.y, randomSpawnPoint.position.z) + (spawnHeight * LocalUp); transform.rotation = randomSpawnPoint.rotation; }
private void Start() { arena = FindObjectOfType <HypeGateTimeBehavior>(); _raceManager = FindObjectOfType <RaceManager>(); if (_raceManager == null) { Debug.LogError("Race Manager not found!"); } cheating = true; StartCoroutine(arenaWarp()); StartCoroutine(distanceKill()); }
// Start is called before the first frame update void Start() { _raceManager = FindObjectOfType <RaceManager>(); if (_raceManager == null) { Debug.LogError("Race Manager not found!"); } if (arena != null) { arena = FindObjectOfType <HypeGateTimeBehavior>(); } if (!respawnOverride) { if (GameObject.FindGameObjectWithTag("AISpline") != null) { SpawnOnNearestSplinePoint(); } else { Debug.Log("There is no AI Spline in the scene"); SpawnOnSelf(); } } else { if (_playerObject.GetComponent <AICheats>().getPlayersIn()) { SpawnOnArenaSpawnPoint(); } else { SpawnBehindPlayer(); } } StartCoroutine(RespawnSequence()); Destroy(gameObject, 5); }