Why the enemy is spamming the attack?

I have a attack method which prints a statement when the enemy is attacking the player the problem is that the enemy is spamming the attack how I can done it like rick ? It was printing the statement every couple of seconds I guess

Share the code where the print is. Then we may perhaps see where the problem is

Hi Hasan,

Have you already compared your code to the Lecture Project Changes which can be found in the Resources of this lecture? Make sure the code for shooting does not get called each frame.

If you exposed the delay variable in the Inspector, you’ll have to adjust the value there because the Inspector controls the value of that variable.

Since I do not know anything about your project, this is just a guess, though.


See also:

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms