Hey all,
I’m setting up a stamina system and I’m trying to work around how I can bind a function with parameters to a delegate.
In my code, I declare the delegate:
DECLARE_DYNAMIC_MULTICAST_DELEGATE(FOnStaminaDepleted);
UPROPERTY(BlueprintAssignable)
FOnStaminaDepleted OnStaminaDepleted;
I have the sprint function (among many I’ll make down the line) that I want to be called with the value automatically set to false.
void Sprint(bool ToggleAbility);
I’m sure there must be a way to bind a function with an param to param-less delegate and preset it so that whenever the delegate is broadcast, it calls the function and passes false to it.
Any help would be appreciated.
Thanks!