- Home /
Question by
Geniusme56 · Sep 19, 2021 at 04:49 PM ·
jitter
Scene is not loading
When I press play and go to the first door, it works fine. But when I go to the second door, the scene switches but it jitters and in the hierarchy it says scene not loading. How can I fix this?
Here is script using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.SceneManagement;
public class KillPlayer2 : MonoBehaviour
{
public int Respawn;
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
}
void OnTriggerEnter2D(Collider2D other) {
if (other.CompareTag("Player"))
{
SceneManager.LoadScene(Respawn);
} }
}
Comment
Answer by Geniusme56 · Sep 19, 2021 at 07:37 PM
Got it. I spawned the character too close to the door back so it glitched forward and back.
Your answer