fmod / fmod-for-unreal

FMOD Studio integration with Unreal.
https://fmod.com/resources/documentation-unreal
MIT License
202 stars 84 forks source link

Fix unnecessary ticks in FMODAudioComponent #33

Closed dsfishlabs closed 6 years ago

dsfishlabs commented 6 years ago

Currently FMODAudioComponent uses the default value for PrimaryComponentTick.bStartWithTickEnabled, which is true. This causes the component to tick, even if Auto Activate is disabled. In that case the TickComponent() function won't even do anything, because it checks the bIsActive flag.

Setting PrimaryComponentTick.bStartWithTickEnabled to false in the constructor solves this problem. Whenever the event is started PlayInternal() will activate the tick by calling SetComponentTickEnabled(true).

dsfishlabs commented 6 years ago

I just noticed that the change was already done on the 4.20 branch.