Is there any chance that we could get timer and delegate handles in variables in blueprint? Right now using delegates in blueprints can make things really gross really quick because all of your delegate binding and unbinding has to live in the same eventgraph and it all has to tie to the same output of the bound event. Afaik they’re just wrappers for ints, so I’m not sure why they’d be too difficult to put in and they’d make it much easier to make good looking blueprints.
These are my thoughts. I think if I didn’t do most of my stuff in C++ I’d probably never notice, but assigning/clearing delegates works so much better on that side that doing it in blueprints feels even clunkier.
Not sure precisely what it is you want to be able to do, but I think the CreateEvent node would handle most of it. That will give you a square delegate pin for the function/event you select, which you can use with the binding functions. It allows you to setup/remove bindings from within a function graph or different event graph.
For timers, you already have the dedicated timer handle which you can use to cancel the timer, and since timers are not multicast then that’s effectively the same thing as unbinding.
It’s true delegate support in blueprints is limited, in particular passing delegates/callbacks as parameters, but I think that’s probably intentional to keep things simple.
The problem is that I can’t save the CreateEvent node’s output pin into a variable, so if I want to clear a bound delegate or assign a delegate in a lot of places, they all need to exist in the same graph as the CreateEvent node, and it makes your blueprints really ugly. Essentially what I want is to be able to save the CreateEvent node’s delegate pin value into a variable so every reference in my blueprint is stuck to that pin in the same eventgraph instead of being able to do it in functions/macros/separate event graphs.
Timer’s had the same problem, but I see that Timer Handle’s were switched to a blueprint type in a later version than the one I’m developing on. So pretty much what I want for delegates is what they added for timers.
Well I’m pretty sure you can just use another CreateEvent node, set to the same function, and plug that into an Unbind node or whatever. Haven’t tested it, but it’s basically just identifying a function by name so pretty sure that would work.
I agree though, without having delegate variables then you’re limited to when you know at design time what will be bound to what.