In the lacture 105 this code shotcounter -= Time.deltaTime (video time = 4:38) but I dont understand why does this code need for making enemy shoot ? still I am confuse pls.
Hi Farhad,
The Update method gets called multiple times per second. We want some delay. Have you already looked up the definition of Time.deltaTime
in the API?
Yes I know about Time.deltaTime…
We use shotcounter - = Time.deltaTime for delaying enemy shoot…am I right here?
Yes, that’s right. At some point, we set shotcounter
to a value, and each time our method gets called, we decrease the value of shotcounter
until the value is equal or lower than 0. Then we shoot, and set the shotcounter
value back to the initial value. And so on.
Yes I have understood now…ThankYou Nina you are very helpful…
You’re welcome. Enjoy the course.
This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.