Hey guys, usually I’m fairly decent with debugging but this seems fairly hard to google. I am basically trying to check if time < time + cooldown time however using a float of 0.3 (which seems like .3 of a second? or something low) it always seems to return true even after waiting for a long time?
Should I be using something besides float? I tried to make an actual Time class variable but obviously that didn’t work out for me. Code below.
using UnityEngine;
using System.Collections;
public class Stats : MonoBehaviour {
public int HP = 100;
public int score = 0;
public int currentCombo = 0;
public int bestCombo = 0;
public float lastKill = 0f;
public float comboTime = .3f;
void Combo (){
if (Time.time < Time.time + comboTime) {
currentCombo ++;
}
else {//if (Time.time > Time.time + comboTime) {
if (bestCombo < currentCombo) {
bestCombo = currentCombo;
}
currentCombo = 0;
}
}
}
FYI Combo is called by sendMessage on each enemy death which seems to be working fine and the else if is commented out because I was trying to get ANYTHING else to return. Thanks!!!