Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do I get only the x Value of the mouse? [Not Solved]

Asked by 10 years ago
Player = Game.Players.Player1
Mouse = Player:GetMouse()

while true do
local person = game.Workspace.Player1
if person ~= nil then
script.Parent.BodyGyro.cframe = Mouse.Hit.X ----Here
end
wait()
end

For those who wonder, when printed it gives you a big number like.

61.6526031, -0.00999999046, -81.8329086, 0.8998546, 0.313777715, -0.302993745, -0, 0.69463712, 0.719360292, 0.43618995, -0.647319674, 0.62507242

When in the Wiki it states its only a X and Y value...

0
Are you trying to get the X value on the screen, or are you just trying to make a new CFrame with the hit's X value? 2eggnog 981 — 10y
0
When I remove the X the brick faces where the mouse points (Useful for 1st person shooters) But the problem is I don't need the brick to rotate vertically. Which is why I only need the X value. Orlando777 315 — 10y
0
You're still not being very clear. It'd be a lot easier to help if you described *exactly* what you want to happen using clear terminology. 2eggnog 981 — 10y
0
Okay, I'm making a 3rd person FPS. When aiming the body will follow the mouse target, but I don't want the morph to lean along the Y axis. Orlando777 315 — 10y

1 answer

Log in to vote
-5
Answered by 10 years ago

..., mouse.Hit.X is 1 number, try CFrame.new(Mouse.Hit.X,0,0)

0
It doesnt give me an error but it does nothing now. Orlando777 315 — 10y
Ad

Answer this question