I’m making a simple game and when I have a cube(“Player”) enter a collider I want the scene to load into the menu screen. The code I have for it is
using System.Text;
using System.Collections;
public class Movement : MonoBehaviour
{
public float moveSpeed;
// Use this for initialization
void Start()
{
moveSpeed = 8f;
}
// Update is called once per frame
void Update()
{
transform.Translate(moveSpeed * Input.GetAxis("Horizontal") * Time.deltaTime, 0f, moveSpeed * Input.GetAxis("Vertical") * Time.deltaTime);
}
void OnTriggerEnter(Collider other)
{
if (other.tag == "Correct")
{
Debug.Log("Enter");
}
if (other.tag == "Incorrect")
{
Debug.Log("Exit");
}
}
}
I have triggers on both the cube and the platform I want the collider to activate on. The tags are also set properly, any tips?