i tried to make a system when the player touched the trigger a point would be given but even if it touched did not touch a trigger it will give points here is an example picture [154427-aantekening-2020-03-17-195637.png |154427]
i eould change scenes if it reached 8 “points” but first i tested it with a debug.log but… it did not work
here is the code:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Pointsssssss : MonoBehaviour
{
// Start is called before the first frame update
private int points = 0;
void Start()
{
}
// Update is called once per frame
void Update()
{
if (points == 8); {
Debug.Log("you have 8 points");
}
}
void OnTriggerEnter(Collider other){
points += 1;
}
}
have a nice day!,i tried to make a point system if you have 8 that you could go to the next level but it always goes up even though the trigger hasnt been entered this is a picture that has been taken of it [154427-aantekening-2020-03-17-195637.png |154427]
here is the code i used
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Pointsssssss : MonoBehaviour
{
// Start is called before the first frame update
private int points = 0;
void Start()
{
}
// Update is called once per frame
void Update()
{
if (points == 8); {
Debug.Log("you have 8 points");
}
}
void OnTriggerEnter(Collider other){
points += 1;
}
}
have a nice day!