what happens from scripts when you crash on a wall, do you reload scene or something else?
when you turn off the stage, then everything returns as it was.
The script seems to work fine, no errors.
can you show that part of the script?
This is the player’s death script
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
public class PlayerDeath : MonoBehaviour
{
public int Respawn;
public GameObject player;
void OnTriggerEnter(Collider other)
{
if (other.CompareTag("trap"))
{
SceneManager.LoadScene(0);
}
}
}
And this is the player’s movement
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
[RequireComponent(typeof(Rigidbody), typeof(BoxCollider))]
public class PlayerController : MonoBehaviour
{
[SerializeField] private Rigidbody _rigidbody;
[SerializeField] private FixedJoystick _joystick;
[SerializeField] private Animator _animator;
[SerializeField] private float _moveSpeed;
private void FixedUpdate()
{
_rigidbody.velocity = new Vector3(_joystick.Horizontal * _moveSpeed, _rigidbody.velocity.y, _joystick.Vertical * _moveSpeed);
}
private void OnTriggerEnter(Collider other)
{
if (this.CompareTag("Player") && other.CompareTag("Finish"))
{
SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex + 1);
}
}
}
yup load scene has had similar issues before, maybe this is the recent workaround/fix:



