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:
- Forum User Guides : How to apply code formatting within your post
- Forum User Guides : How to mark a topic as solved
This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.