Skip to main content

On Sale: GamesAssetsToolsTabletopComics
Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

It depends on the type of game. Some games people expect to play with a mouse, while others are played with a controller and/or keyboard. If your game is one that people expect to play with a mouse, then disabling it will likely negatively impact your game's reception.

However, if your game is the type where people typically use a keyboard or gamepad, disabling the mouse shouldn't be a problem.

That said, based on your description, I agree with @redonihunter: disabling the mouse should be a design decision, not a patch to fix a bug.

Your problem is that the character needs to interact, not the cursor. You have two solutions: check the cursor's position relative to the character. If it's over the character, the click counts as an "action"; if it's far away, it counts as a "movement."

Another solution is to leave the mouse code as is and add a condition when the "action" is executed, requiring the character's position to be over or near the object attempting the action.

To be honest, I hadn't thought of either of the solutions you suggest, but I think they would negatively affect the gameplay in my game. 

Imagine that the player clicks on a piece of furniture to open it. With the first click, they position themselves but don't open it, so they would have to click again... and so on with the hundreds of drawers, books, and other objects in the game...

I'm going to try leaving the left mouse click for moving, but leaving the action button on the keyboard or changing it to the right click.

Thanks for the advice anyway, best regards!