- Home /
GameObjects turn invisible when i teleport the Player's transform to a respawn point.
Ok, i've learned more about C# programming, and I only look to tutorials when I just CAN'T DO SOMETHING. But, I haven't found any tutorials about this, so I'm looking towards you guys. It doesn't give me any errors, but when I click retry, the music is at the normal pitch and speed, the time is at a normal speed, I can control my player, but every GameObject except the UI and player turn invisible. Here's my code. Idk how to put the whole script in the "code" section, sooooo...
using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.SceneManagement;
public class DeathMenuFunctions : MonoBehaviour {
// I have the other functions in another script so yea
public Transform player;
public Transform respawnPoint;
public GameObject deathMenu;
public AudioSource music;
public void Retry()
{
player.transform.position = respawnPoint.transform.position;
Time.timeScale = 1f;
music.pitch = 1.0f;
deathMenu.SetActive(false);
}
}
Your answer
Follow this Question
Related Questions
DontDestroyOnLoad object 1 Answer
Disable diagonal movement in Character Controller Unity 3D 0 Answers
CG compiled to GLSL: hyperbolic functions not found. 0 Answers
Advice wanted on state transition code. 2 Answers
Service not available 0 Answers