Most of the time it won't work because the value of time won't be the exact value that you defined in your variables. It is mostly likely that you could get a result like this; time = 35.00000123 and your FirstPass = 35.00000000 which these two values don't match. What you can do is comparing these two values with the following, either you comparing using Mathf.Approximate or just Round your time value using Mathf.Round and it will be all fine then.
↧