Hi all,
I want to use an Enhanced input action that does the following:
- When clicking and holding the left mouse button, the game draws a selection rectangle on the screen (the drawing of rectangle is working)
- if the player only clicks the left mouse button some other actions should be handled.
Any idea how I can accomplish this?
Hi and thanks for the answer.
But that part I got figured out.
I want to be able to have the left mouse button do multiple things depending on if the player is dragging the mouse or not
1 Like
You have to be more specific than that. Whatever “thing” it is you want could require a completely different approach.
But, in general, I imagine your approach is to assign the INPUT ACTION MAPPING to the LEFT MOUSE BUTTON, and from there you can use “Ongoing” for drawing the polygon, and “Started” for executing whatever “thing” function you’re looking for. Just make sure there’s a “Completed” condition.

Hi,
Thanks to your answer I got a little bit further but it’s not perfect yet.
To clarify, the game has the same controls as a RTS game. The player can hold left mouse button and drag a selection box on screen, after releasing the left mouse button the units in the box get selected.
At the same time if the player just clicks the left mouse button other actions are executed. For example order the units to move somewhere.
The way I have it setup now:
After the input action started I handle the other actions. When the action has elapsed for a certain amount of seconds the dragging is handled. Because it means the player hasn’t just clicked but is holding the mouse button. Lastly if the user releases the mouse button the dragging is finished.
1 Like