using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class airtime : MonoBehaviour {
// Use this for initialization
float sayac = 0;
float combo = 0;
public bool on_air = false;
void Start() {
}
// Update is called once per frame
void Update() {
if (sayac > if)
{
on_air = true;
combo++;
sayac = 0;
Debug.Log("Havada":+combo);
}
sayac += Time.deltaTime;
}
void OnCollision2D(Collision2D coll)
{
if (coll.gameObject.tag == "Player" || coll.gameObject.tag == "teker")
{
combo = 0;
sayac = 0;
on_air = false;
}
}
void OnCollisionStay2D(Collision2D coll)
{
if (coll.gameObject.tag == "Player" || coll.gameObject.tag == "teker")
{
combo = 0;
sayac = 0;
on_air = false;
}
}
What is the problem? Cna you help me please?