#Output Structure# The MouseDown method will return a boolean value of true if the mouse button is pressed down, and false if it is not. Hi, I’m working on making a custom build mode camera controller which is generally going well, however I was wondering how I could go about restoring the right click to lock cursor position feature that exists by default My camera’s CameraType is Scriptable and I believe this removed the mouse locking ability. It is also important to note that the mouseButton parameter must be an Enum.UserInputType value, and not a string. To detect mouse button releases, you must use the MouseUp method. #Common Mistakes# It is important to note that the MouseDown method will only detect mouse button presses, and not mouse button releases. #Example# lua local mouseButton = 1 local buttonDown = UserInputService:MouseDown(mouseButton) if buttonDown then print("Mouse button pressed down") end This will print "Mouse button pressed down" to the console if the left mouse button is pressed down. #Syntax# lua local buttonDown = UserInputService:MouseDown(mouseButton) This will return a boolean value of true if the mouse button is pressed down, and false if it is not. It is a part of the UserInputService class. The MouseDown method is used to detect when the mouse button is pressed down.
0 Comments
|
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |