I have an auto attack set up for my game. When the characters reach a specific X and Y location they start to attack. The goal is for the auto attack to run every 3 seconds.
to do this, I have a runtime event listener that controls the movement and also tracks the X and Y in order to trigger the attacking.
the problem that I have seemed to realize is that due to the frame rate, this actually triggers many times.
So if I make a single attack do 10 damage, it actually attacks for 10 damage multiplied by whatever the frame rate is.
I’ve tried using a timer.performWithDelay, but that was not a good solution.
anyone have an Idea of how I can make the character attack once they reach a certain point and from then on, attack only once every 3 seconds?