Bug: Weapon firerate slows with framerate drops

Woods

New member
I have been having an issue with the firerate dropping on the assault rifle if the FPS drops. Yesterday I realized it was tied to the character animator being forced to update in Normal mode by the AnimatorMonitor. This does seem to have better performance with lots of characters, but causes the firerate to lag since the start/complete events in weapons are taking longer to execute.

I think the AnimatorMonitor should let me choose which update mode so that I can allow my player to use Animate Physics to resolve firerate lag, while leaving AI agents in the better performance Normal mode.

Are there any potential side effects of using AnimatePhysics? I havent had any issues yet, but this comment in AnimatorMonitor tells me its a fairly recent requirement
Code:
            // As of version 3.0.10 the Animator should be updated within the normal Update loop.
            m_Animator.updateMode = AnimatorUpdateMode.AnimatePhysics;
 
The Animator should be updated within Update for high refresh rate monitors. For low framerates you can use a timer for the events which will take into account framerate.
 
Ok so its better to disconnect the weapon use/complete events from animations and just use timers. Will give this a try tomorrow, thanks!
 
Top