Question by
michael6252 · Nov 18, 2016 at 06:47 PM ·
level selectblocking
Hi Guys, I am busy with a level locking system
but it doesn't seem to work, it should be that if you have the right amount of point(score) in total the level should open or it should show a debug log. Below is my script. Still new to all of this so would be amazing if someone could help.
public bool levelPassed = false;
public int levelTarget = 0;
public int Points { get; private set; }
// Update is called once per frame
void OnTriggerEnter(Collider2D other)
{
if (other.gameObject.tag == "Player")
{
if (Points >= levelTarget)
{
levelPassed = true;
Debug.Log("level is now open");
}
else
{
levelPassed = false;
Debug.Log("level is still locked");
}
Comment
Your answer
Follow this Question
Related Questions
how to make a level block/unblock 1 Answer
I need fix my character selection problem 0 Answers
Block physics raycast on gameobjects if UI element was clicked 3 Answers
Level selection 0 Answers