Cannot use UObject method delegates with raw pointers

Am trying to create a timer for an actor and something doesn’t seem to be working out right. I don’t know how to make it work.

I have this code which compiles and works.

GetWorldTimerManager().SetTimer(CountdownTimerHandle, this, &Anewactor::AdvanceTimer, 1.0f, true);

(Anewactor class inherits from AActor and does nothing except the test timer).

I have another class that inherits from AActor and this code

		FTimerHandle DummyHandle;
		GetWorldTimerManager().SetTimer(DummyHandle, this, &APrinceMainMenu::TestTimerTrigger, SoundDuration, false);
		GetWorldTimerManager().SetTimer(DummyHandle, this, &APrinceMainMenu::LoadFrontEndMap, SoundDuration, false);

This code fails to compile with the error.

You cannot use UObject method delegates with raw pointers.

What am I missing out ?

Hey asla-

What class is APrinceMainMenu? Where is your UObject? If you add the asterisk after FTimerHandle to make DummyHandle a pointer rather than a variable does the second set of code compile?

Hi asla,

We have not heard back from you in a few days, so we are marking this post as Resolved for tracking purposes. If you are still experiencing the issue you reported, please respond to this message with additional information and we will offer further assistance.

Thank you.