I’m making a Earthbound fan game, and i’m having trouble naming the charterers he’s my code
using UnityEngine;
using UnityEngine.SceneManagement;
public class Askname : MonoBehaviour
{
private new string name;
[SerializeField] private string Stl;
public AudioClip SoundToPlay;
private new readonly AudioSource audio;
void OnGUI()
{
name = GUI.TextField(new Rect(10, 10, 200, 50), name);
if (Input.GetKey(KeyCode.KeypadEnter))
{
NextScene();
}
}
void NextScene()
{
audio.PlayOneShot(SoundToPlay);
SceneManager.LoadScene(Stl);
}
}
It would really help if could answer this thank you if you do.