- Home /
,LoadSceneIfClicked doesn't work properly.
using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.SceneManagement;
public class LoadSceneIfClicked : MonoBehaviour { [SerializeField] string ToLoadScene; // Start is called before the first frame update void Start() {
}
// Update is called once per frame
void Update()
{
}
private void OnMouseDown()
{
SceneManager.LoadScene(ToLoadScene);
}
} I use the script in two diffrent scripts. It works in teh first one but not in the second. Please help!, using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.SceneManagement;
public class LoadSceneIfClicked : MonoBehaviour
{
[SerializeField]
string ToLoadScene;
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
}
private void OnMouseDown()
{
SceneManager.LoadScene(ToLoadScene);
}
}
I used the same script in two diffrent scripts and its working in the first one, but not in the second. Why?
Your answer
Follow this Question
Related Questions
Make touch buttons transparent 2 Answers
How can I get a data from function to other function? 2 Answers
Add force when button is pressed 2 Answers
having trouble adding a button to end session 2 Answers
How to overlap 2 or more UI Elements 1 Answer