generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

How do you set X and Y to mouse?

Previous Thread :: Next Thread 
Eggnivia is not online. Eggnivia
Joined: 30 May 2009
Total Posts: 4144
21 Jun 2014 04:24 PM
Because I just thought you'd enter a number, eg.

Mouse.X = 408

But that's not the case, because it comes up with the error "can't set value"
Report Abuse
Eggnivia is not online. Eggnivia
Joined: 30 May 2009
Total Posts: 4144
21 Jun 2014 04:25 PM
Note:

player = game.Players.LocalPlayer repeat wait() until player.Character
mouse = player:GetMouse()
Report Abuse
badfitz99 is not online. badfitz99
Joined: 01 May 2010
Total Posts: 5854
21 Jun 2014 04:26 PM
I don't think you can

-- Scripter of Off-Topic --
Report Abuse
Notunknown99 is not online. Notunknown99
Joined: 05 Sep 2008
Total Posts: 25360
21 Jun 2014 04:26 PM
Impossible.
Report Abuse
Eggnivia is not online. Eggnivia
Joined: 30 May 2009
Total Posts: 4144
21 Jun 2014 04:27 PM
Okay then, that's fine; I'll go back to the main question. Does anybody know how to lock the mouse in the center of the screen?
Report Abuse
ManMinded is not online. ManMinded
Joined: 07 Oct 2012
Total Posts: 618
21 Jun 2014 04:29 PM
game.Workspace.CurrentCamera.CameraType = "Attached"
Report Abuse
Notunknown99 is not online. Notunknown99
Joined: 05 Sep 2008
Total Posts: 25360
21 Jun 2014 04:30 PM
Player.CameraMode = "LockFirstPerson"
Report Abuse
Eggnivia is not online. Eggnivia
Joined: 30 May 2009
Total Posts: 4144
21 Jun 2014 04:31 PM
With CameraMode, could you change the CameraSubject afterwards and keep the mouse locked?
Report Abuse
Notunknown99 is not online. Notunknown99
Joined: 05 Sep 2008
Total Posts: 25360
21 Jun 2014 04:31 PM
No, HAS to be Classic.

No idea why, but that's ROBLOX for you.
Report Abuse
Notunknown99 is not online. Notunknown99
Joined: 05 Sep 2008
Total Posts: 25360
21 Jun 2014 04:32 PM
Oops,

CameraType HAS to be Classic.
CameraSubject HAS to be your Character's Head.
Report Abuse
xXIcanthinkofanameXx is not online. xXIcanthinkofanameXx
Joined: 05 May 2012
Total Posts: 857
21 Jun 2014 04:33 PM
There is one way that I've found however it doesn't yield nice results:

local player = game.Players.LocalPlayer
local camera = workspace.CurrentCamera
local mouse = player:GetMouse()
player.CameraMode = "LockFirstPerson"
camera.CameraType = "Scriptable"

function lockMouse()
camera.CameraType = "Custom"
end

function unlockMouse()
camera.CameraType = "Scriptable"
end

Everytime you lock the mouse, it turns your player invisible, and it will zoom in on the head. I wouldn't use this, unless it's the only method available at the time.
Report Abuse
Eggnivia is not online. Eggnivia
Joined: 30 May 2009
Total Posts: 4144
21 Jun 2014 04:33 PM
Dang flabbit. I won't bother asking about Attached, I'd just assume the same principle applies.
Report Abuse
Eggnivia is not online. Eggnivia
Joined: 30 May 2009
Total Posts: 4144
21 Jun 2014 04:34 PM
XXI that could actually work because I'm not using the player to control the game. I completely forgot about Scriptable, I'll give it a try
Report Abuse
Notunknown99 is not online. Notunknown99
Joined: 05 Sep 2008
Total Posts: 25360
21 Jun 2014 04:34 PM
ROBLOX is very bad at giving game developers control over user input :/
Report Abuse
xXIcanthinkofanameXx is not online. xXIcanthinkofanameXx
Joined: 05 May 2012
Total Posts: 857
21 Jun 2014 04:35 PM
^ Indeed
Report Abuse
ManMinded is not online. ManMinded
Joined: 07 Oct 2012
Total Posts: 618
21 Jun 2014 04:35 PM
not is saying:

local camera = game.Workspace.CurrentCamera
local player = game.Players.LocalPlayer
camera.CameraType = "Classic"
camera.CameraSubject = player.Character.Head
Report Abuse
ManMinded is not online. ManMinded
Joined: 07 Oct 2012
Total Posts: 618
21 Jun 2014 04:36 PM
+

camera.CameraMode = "LockFirstPerson"
Report Abuse
Notunknown99 is not online. Notunknown99
Joined: 05 Sep 2008
Total Posts: 25360
21 Jun 2014 04:41 PM
No, player.CameraMode = "LockFirstPerson".

I have no idea who decided "Oh, I know! Lets put camera controls in the Player!"
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image