Playmaker Forum

PlayMaker Feedback => Feature Requests => Topic started by: Farwest on July 03, 2019, 01:57:51 PM

Title: Mouse UP/DOWN Global Events for Right Click (System Events)
Post by: Farwest on July 03, 2019, 01:57:51 PM
Summary:
A picture is worth a thousand words:
(https://i.ibb.co/hcBXd7V/Mouse-Down-Up-Global-Event-Issue.png)

Details:
Instead of using "Get Mouse Button Up/Down" actions, I need to use Global Events (Global Transition>System Events) for Mouse Up/Down for Right Click over States and it seems that MOUSE DOWN and MOUSE UP global events are working for left click only and I don't want to mess with Unity's Inputs.

Is it possible to have seperate Global Events for Mouse Down and Mouse Up for Right Click only?

Reason:
I don't want to use Mouse Over>Get Mouse Button Up/Down which Mouse Over seems to me a clumsy approach for Mouse Down events (Mouse Down shoots the event once, but if I do same thing with Mouse Over, it resets the State Event chain before it finishes especially if FSM transitions take more than a frame, thus Mouse Over is not useful and having Mouse Down working for Left click is limiting us in design)

Thanks
Title: Re: Mouse UP/DOWN Global Events for Right Click (System Events)
Post by: Thore on July 03, 2019, 07:28:21 PM
You can make a new FSM that handles the input (generally a good idea), where you listen for the right mouse button and then send a global event. Then you can start your current FSM with that global event.

(your picture doesn't show up)
Title: Re: Mouse UP/DOWN Global Events for Right Click (System Events)
Post by: Farwest on July 04, 2019, 09:54:48 AM
But there will be multiple objects that would listen same Global Event. Thus I fear it may confuse all objects with same Right Click with that approach.

In my approach, only a specific gameobject will open Tooltip UI when clicked on that gameobject only. MouseDOWN/UP Events work, but I need their Right Click versions. (MouseOver works too, but there are occasions where I don't prefer using MouseOver often, there is danger it resets the State Machine to beginning MouseOver state before State transitions finish)

Thanks, I fixed the image too, it seems I couldn't make "Insert Image" work so I used Hyperlink function now.
Title: Re: Mouse UP/DOWN Global Events for Right Click (System Events)
Post by: Thore on July 04, 2019, 10:47:23 AM
Okay, that seems by design from Unity, see here (https://forum.unity.com/threads/onmousedown-for-right-click.7131/).

You can use the Input Manager, too, and in PM the get button down actions in a one state that listens for both inputs (each wired with a different event to your two existing states).
Title: Re: Mouse UP/DOWN Global Events for Right Click (System Events)
Post by: Farwest on July 04, 2019, 12:37:57 PM
Yes it (https://forum.unity.com/threads/onmousedown-for-right-click.7131/) is unfortunate to see.

I did that way, it didn't work efficiently in same FSM with other inputs, but it worked good under different FSM which is dedicated for listening Right Click only (MouseOver>get mouse button down-Right to open the UI, same state get mouse button up-Right to close the UI). Thanks for your suggestions.

The Feature request I did for Having Mouse Up/Down Global Events with Right Click still exist, which I hope it will be very handy than need to create action chains or seperate FSMs to work with.