It’s easy to add OnClick and OnRelease events to a blueprint but there’s no sign of double click.
I could work around this with a timer but Click events are dropped when clicking quickly. I’ve logged OnClick and OnRelease events and when I double-click I see one Click and two Releases! The Project Settings/Input/Mouse Properties/Double Click Time value seems to have no effect on this.
NOTE: I’m wanting to detect the double-click on a specific object, not in general.
This would allow for Double Clicking on an object in the level (Shape_Cube in my example) and executing script only if Double Clicked on the specified object. It’s similar to what you were going for with the timer except I used a delay node and counted the number of clicks before branching (resetting if only one click was registered).
I dont know how costly ticks are, I found a way of doing it by holding the time that the key was pressed last and only triggered on that key press again (first post, sorry if I’m necoing and old thread, came across it while google in the same thing) .Only my second day trying unreal, I think I’m going to be here a lot
This allows me to detect double key press up and double key press down to run (I also detect hold shift with a different method). To me, this method seems very simply and not costly ???
Hey everyone, I figured out a very cost efficent method that worked very well for me and very easy to make. It used one int to count the clicks and a sequence that triggers a delay after the first click, then you can specify into the switch int, as much as clicks as you want to stuff to happens and the best thing is that it doesnt involve the update tick, let me know if it works for you
Funnily enough I was about to post an alternative after reading this thread yesterday (funny as it’s an old thread) - I was looking for a way to separate single and double clicks using a macro and came up with this. My main aim was to avoid single clicks when double clicking.
antoinegloum’s widget based solution was really nice and clean. But since it uses a variable anyway, there’s really no need for a sequence or gate.
Here’s an easier to read solution that does the same job.
Oh, and I should note that I names the outputs 1st press and double press (rather than 1st and 2nd or single and double), because a 1st press isn’t guaranteed to be a single press (as a second press might still happen), and a subsequent press second is still a 2nd press whereas double press implies it was within the threshold.
Nice, that makes sense, I was canceling the action of the single click when the double click was activated but executing only one of it could make my whole code simpler, I will check if it works in my project. Yeah its a old topic but I always end up here somehow hehe