using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.SceneManagement; public class Menu_Script : MonoBehaviour { public string nextSceneName; private GameObject scrollingText; // Start is called before the first frame update void Start() { scrollingText = GameObject.FindWithTag("ScrollingText"); } // Update is called once per frame void Update() { if (scrollingText) { scrollingText.GetComponent().localPosition = new Vector2(0, scrollingText.GetComponent().localPosition.y + Time.deltaTime * 40f); } if (Input.GetKeyDown("space")) { if (nextSceneName != null) { SceneManager.LoadScene(nextSceneName); } } } }