Hi,
I really need help. I try create moving between levels in my 2D game, but… it doesn’t work. I have unity version 2017, script is good, game works, in build settings I have my scenes, but… i don’t know what is wrong. Collider Box doesn’t moves player to second scene, I’m non-stop in first scene.
So… that thing doesn’t work. I think maybe that version is wrong? In this video unity is version 5.0, so maybe that’s why it doesn’t work?
This is my code:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class LoadNewArea : MonoBehaviour {
public string levelToLoad;
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
}
void OnTriggerEnter2D(Collider2D other) {
if (other.gameObject.name == "Gracz")
{
Application.LoadLevel (levelToLoad);
}
}
}