BindAction delegate with parameters
I have the same question than this guy: https://answers.unrealengine.com/questions/4332/question-bind-action-passing-parameters.html
is there any update about this?
asked Dec 09 '14 at 04:45 PM in C++ Programming
As of Unreal 4.18 an templated BindAction<>() was added.
To use it:
Generally, to create a delegate with a parameter you would include the parameter in the declaration as such:
And create a variable for the delegate normally:
At this point you can bind the function to call when the delegate is triggered:
Assuming the function
The link in BaderThanBad's answer provides an example of setting up a delegate with a parameter. You can also check the documentation for delegates, https://docs.unrealengine.com/latest/INT/Programming/UnrealArchitecture/Delegates/index.html , for more info.
answered Oct 27 '15 at 06:12 PM
I just went through this, including temporarily using an integer template argument wrapper function that was uncannily similar to your comments on the other answer. However, I eventually arrived at this, which I think is pretty elegant:
Follow this question
Once you sign in you will be able to subscribe for any updates here