How do you make mouse movable while holding right-click?

What do you want to achieve?
I want to make MouseButton2 or RMB to be movable while holding the key

What is the issue?
So the issue is I can’t move the mouse while Holding Right-click, I don’t know if it’s possible

Did you look for solutions on the Developer Hub?
Yes I have looked everywhere to find how to make right-click mouse to be movable. Maybe the problem here is my isometric camera script because without it I can move the camera but the mouse doesn’t. I’m using the Right-click mouse to make like a targetting system from Project Zomboid. Which you have to hold right click to make your character face where the mouse is. Maybe I should just make it into KeyCode.

Reference on the targetting/aiming system:

Try this:

game.ContextActionService:BindAction(
	"SinkMouseButton2",
	function ()
		return Enum.ContextActionResult.Sink
	end,
	false,
	Enum.UserInputType.MouseButton2
)
1 Like

It seems to work but now my character won’t face while I hold right-click

Setting Camera.CameraType to Scriptable should fix your problem.

Thank you, this works like a charm!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.