makssem
Ученик
(162),
на голосовании
9 месяцев назад
Не знаем как решить эту ошибку вот код:using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; using UnityEngine.SceneManagement;
public class Damag : MonoBehaviour { public float health = 100; public float times; public float trigger;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.SceneManagement;
public class Damag : MonoBehaviour
{
public float health = 100;
public float times;
public float trigger;
void Update()
{
times * Time.deltaTime;
if (health <= 0){
SceneManager.LoadScene(SceneManager.GetActiveScene().level1);
}
}
void OnTriggerEnter(Collider other)
{
if (other.gameObject.CompareTag("player")) {
trigger = 1;
}
}
void OnTriggerEnter(Collider other)
{
trigger = 0;
}
void damage()
{
if (trigger == 1){
if (times > 2) {
health -= 15;
times = 0;
}
}
}
}