So I have the following functions below being called by character input functions.
I have verified that StartFire() and StopFire() are being called correctly with a debug message. I know that ASWeapon::Fire function works because I can manually call it in blueprint and it works as intended. I also tried manually calling Fire() directly in the character input functions and It works.
However what i’m trying to accomplish is using a timer to handle time between shots. This code worked in unreal 4.27 but does not work in 5.0, I tried 5.0.3 and now I have tried it on 5.2.1 and I get the same result. Am i missing something or is something actually just wrong with SetTimer()?
void ASWeapon::StartFire()
{
GetWorldTimerManager().SetTimer(TimerHandle_TimeBetweenShots, this,
&ASWeapon::Fire, 1.0f, true, 0.0f);
}
void ASWeapon::StopFire()
{
GetWorldTimerManager().ClearTimer(TimerHandle_TimeBetweenShots);
}