I can't use UObject method delegates with raw pointers
I'm quite a newbie in C++ I agree with it... I have an error that I don't really understand :
If I do this :
It gives me :
What does that means ? Why can't I do this ?
edit : This seems to occur because I try to set a timer from a non-UE class (it's not an actor, not a blueprint, not a controller...), so how can I manipulate a "big global" timer from anywhere in the game like I'm trying to do ?
I think what is happening here is that the function GetTimerManager() actually returns a reference not a pointer (denoted by the '&' symbol). To call any function from the FTimerManager object which is returned from GetTimerManager() you need to use a '.' indead of a '->'.
When you have issues like these in the future be sure to take a look at the documentation at https://docs.unrealengine.com/latest/INT/index.html to see what return types are given with functions you are trying to call. This documentation has help me heaps when i get issues like these.
Hope this helps your issue
answered Oct 23 '14 at 09:19 PM
Code For You
Wilson is correct, you should be using . not ->
And you should use GetWorldtimerManager() as long as you are in any Actor extending class.
Additionally here is a code sample to get you started with Timer in UE4, Enjoy!
I have had the same problem, I just added the : public AActor to the header file. Now it complies.
answered Jul 28 '16 at 07:31 AM
Follow this question
Once you sign in you will be able to subscribe for any updates here