Change from "hand" to "grab hand" cursor [SOLVED]

  • #1, z mathias-gTuesday, 06. June 2023, 11:51 hodinky A year ago
    Hello!

    I’m wondering if anyone could help me re-create the functionality of grabbing a “lever” in a direction and play the correct animation when you let go. Like Riven did. So, I would like to change cursor to “grab hand” when clicked and fire some script when I let go of mouse button. I tried using Left Click with a change cursor and then a Hold Button immediate with curPos etc but Left Click action fires actions when released as well.. Any tips?

    Mathias

    Bažant

    5 Posts


  • #2, z afrlmeTuesday, 06. June 2023, 19:27 hodinky A year ago
    When it comes to actions in the action list for objects/buttons, it all comes down to the order you list the commands/actions in.

    It would also help if you could share some screenshots or a video of how you currently have it setup.

    Imperátor

    7285 Posts

  • #3, z mathias-gWednesday, 07. June 2023, 08:55 hodinky A year ago
    Here is a pictue.
    So if I click and release fast it fires "Left click" and all the actions there.
    If I hold the left mouse button and release it fires "Button hold" and all the actions there.

    What I want is for "Left click" to fire before "Button hold":



    Bažant

    5 Posts

  • #4, z afrlmeThursday, 08. June 2023, 15:01 hodinky A year ago
    Left click is always going to take priority as you have listed it at the top of the action list & it's also an immediate action too. Try moving it below button hold, but there's still no guarantee it won't end up being executed if it flags left click on button down instead of button down & release.

    Out of curiosity why are you adding both left click & hold actions to the same object?

    Imperátor

    7285 Posts

  • #5, z mathias-gThursday, 08. June 2023, 23:01 hodinky A year ago
    I want to indicate to the player that he/she is "grabbing" the lever. So I would like the cursor to change to a "grab hand" after the player have clicked on the lever and stay that way as long as they hold it down. As I can see now there is no action that can fire scripts only on button click and not click and release. Both Left click and Button hold fires after click and release... hmm I cant see to figure this one out

    Is there a way to flag both left click and button hold in order?

    Because if I only use button hold the scripts in the button hold action fires after button release. So the cursor will not change to grab hand if I added that to the button hold while the player is holding down the mouse button.

    Bažant

    5 Posts

  • #6, z afrlmeFriday, 09. June 2023, 00:33 hodinky A year ago
    You can't have it execute 2 actions at the same time - to my knowledge. What you could do, however is use a key event handler function to listen out for mouse held & check if object below cursor is x, or you could probably do that in the mouse properties tab belonging to the main game properties section of the editor - at least that's 2 things I can think of.

    Imperátor

    7285 Posts

  • #7, z mathias-gFriday, 09. June 2023, 07:27 hodinky A year ago
    Ah ok smile could you help me with that or is there any online tutorial on making a key event handler function? 

    Bažant

    5 Posts

  • #8, z mathias-gFriday, 09. June 2023, 09:38 hodinky A year ago
    Think I solved it:



    The mouse properties actions helped a lot!

    So now I can in this test-case drag the ball on screen in the direction I move the cursor and it shows the grab hand while im holding down the button!

    Bažant

    5 Posts