Hi im working on a death code and theres a parser error with void in line 14 heres my code:
using UnityEngine;
using System.Collections;
public class Death : MonoBehaviour {
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
void OnTriggerEnter2D(Collider2D other) {
if(other.tag = "Player")
{
{
// Player entered red zone, reload game.
Application.LoadLevel(0);
}
}
}
Im trying to figure this one out but im gonna need more help its says parsing error
using UnityEngine;
using System.Collections;
public class Example : MonoBehaviour {
// Use this for initialization
void Start () {
}
void OnTriggerEnter2D(Collider2D other) {
if(other.tag = "Player")
{
{
// Player entered red zone, reload game.
Application.LoadLevel(0);
}
}
public class Example : MonoBehaviour
{
// Use this for initialization
void Start()
{
}
private void OnTriggerEnter2D(Collider2D other)
{
if (other.tag == "Player")
{
{
// Player entered red zone, reload game.
MediaTypeNames.Application.LoadLevel(0);
}
}
}
}