I am a beginner at unity and i am stuck on making a script that simply changes the scene when a player touches the cube
[Issues= Assets/Scripts/Collision.cs(4,0): error CS1525: Unexpected symbol public', expecting
.’ or ; Assets/Scripts/Collision.cs(4,14): error CS0101: The namespace
global::’ already contains a definition for Collision' Assets/Scripts/Collision.cs(7,8): error CS1519: Unexpected symbol
void’ in class, struct, or interface member declaration]
using UnityEngine;
using System.Collections;
using UnityEngine.SceneManagement;
public class Collision : MonoBehaviour
{
void OnTriggerEnter(Collider other)
{
if(other.CompareTag("Player"))
{
SceneManager.LoadScene(1);
}
}
}