Raycast Double Click

#1

What’s the best way to handle double clicks when using ray casting?

E.g. if the player single clicks on a tile they can move to, the character should walk there. If they double click the character should run.

Currently just waiting 500ms to see if there’s a second event on the same tile and handling appropriately.

Thanks!

0 Likes

#2

That is wat I would do. And 500 is the Windows default Doe double clicking I believen.

0 Likes

#3

double click is also location based, so on click store the current mouse position and on mouse move check whether its out of a certain area. if its out, you know it’s not a double click and you can trigger your single click action immediately. this adds responsiveness since you don’t have to wait 500ms all the time.

1 Like