x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Is there a GetWorldTimerManager().SetTimer() equivalent that supports parameters?

Hello, i want to make a method call after x amount of seconds and for that i have been using GetWorldTimerManager().SetTimer(), but the problem with this is that it does not support sending variables (like AActor and derivated classes) through it. Is there a way to achieve this? Thank you

Product Version: Not Selected
Tags:
more ▼

asked Jul 19 '14 at 10:15 AM in C++ Programming

avatar image

xlar8or
6k 162 129 305

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

Funtion poiter just pointer to the funtion that can be called it does not represent a call, you can't use other arguments of such SetTimer as i compiler does not support identifing argument types of pointed function. So you cant do that direcly with one funtion call in C++, it was limitation of timers also in UE3 even in UnrealScript as well as now in Blueprint.

But you can walk way arround it, like seting some varable when you set timer and pointed funtion would use that varable as argument for pointed funtion. You can do that in single funtion that looks like settimer just will have extra argument which will be used to set the that varable which later be used by pointed funtion.

more ▼

answered Jul 19 '14 at 12:57 PM

avatar image

Shadowriver
37.2k 936 172 1116

avatar image xlar8or Jul 19 '14 at 01:00 PM

Currently i'm using pointers to later access it, but i wanted to find a way to not have that. I'm figured out a way of calling SetTimer with parameters using FTimerDelegate but it only supports simple types like int, float and so on. Is the pointer approach the only way to do this using more complex types?

avatar image Shadowriver Jul 19 '14 at 01:14 PM

Anyway way that pointed funtion can use as argument will work, i just showed one ezample, you seem to figure other ways already ; p

avatar image xlar8or Jul 19 '14 at 02:04 PM

Sorry did not understand very well what you wrote :P

avatar image Shadowriver Jul 19 '14 at 02:23 PM

Any way that can deliver argument to poited funtion will work, i only showed one example

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question