Question by
cyborg2020 · Nov 15, 2016 at 08:36 PM ·
level load
i can't go through level 1 to level 2
im stuck in lvl 1 this is my code ing UnityEngine; using System.Collections; using UnityEngine.SceneManagement;
public class GameManager : MonoBehaviour { public static int currentscore; public static int highscore;
public static int currentlevel=0;
public static int unlockedlevel;
void start()
{
DontDestroyOnLoad (gameObject);
}
public static void Completelevel()
{
SceneManager.LoadScene (currentlevel+1);
currentlevel += 1;
}
}
using UnityEngine; using System.Collections;
public class PlayerMovement : MonoBehaviour { public float moveSpeed; public GameObject deathpaticles; private float maxspeed=5f; private Vector3 input;
private Vector3 spawn;
// Use this for initialization
void Start () {
spawn = transform.position;
}
void OnTreiggerEnter(Collider other) { if (other.transform.tag == "goal") { GameManager.Completelevel(); } }
Comment
im going through the goal (is triggred) and nothing happened
Best Answer
Answer by tanoshimi · Nov 15, 2016 at 09:00 PM
That's because you've written OnTreiggerEnter. The metbod is called OnTriggerEnter.
Your answer