using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class WINORLOSE : MonoBehaviour
{
void onCollisionEnter (Collision Walls )
{
if (Walls.gameObject.tag == “Wall”);
{
Application.LoadLevel(“Game Over”);
}
}
}
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class WINORLOSE : MonoBehaviour
{
void onCollisionEnter (Collision Walls )
{
if (Walls.gameObject.tag == “Wall”);
{
Application.LoadLevel(“Game Over”);
}
}
}
Well, what’s the tag of the object you hit? Maybe you put this script on your Wall, instead of on your player?
OK THank You , I will try
“onCollisionEnter” can not work. You need to replace it with “OnCollisionEnter”
Please use code tags next time, you can access them from the post writing tools when adding a reply or writing a post, itll make it far easier for others to help ![]()
Also Application.LoadLevel is depreciated as far as I am aware, you need to use the newer namespace, read the doc page for it: https://docs.unity3d.com/ScriptReference/Application.LoadLevel.html
You will see its SceneManager.LoadScene you want