KingJacko
|
  |
| Joined: 20 Jun 2008 |
| Total Posts: 3944 |
|
|
| 31 Mar 2015 05:14 PM |
| is there a way to get the Mouse.Y value in scale? |
|
|
| Report Abuse |
|
|
Tuneable
|
  |
| Joined: 16 Feb 2013 |
| Total Posts: 2932 |
|
| |
|
KingJacko
|
  |
| Joined: 20 Jun 2008 |
| Total Posts: 3944 |
|
| |
|
KingJacko
|
  |
| Joined: 20 Jun 2008 |
| Total Posts: 3944 |
|
|
| 31 Mar 2015 05:22 PM |
i need it to somehow go negative because im making the tool follow my mouse. A few problems
1. Since the range is only 0 to 1, the gun does not point upward 2. The gun only moves while in third person, but thats because im firing it with Mouse.Move? |
|
|
| Report Abuse |
|
|
Tuneable
|
  |
| Joined: 16 Feb 2013 |
| Total Posts: 2932 |
|
|
| 31 Mar 2015 05:26 PM |
((Mouse.Y / Mouse.ViewSizeY) - .5) * 2
will this work?
|
|
|
| Report Abuse |
|
|
KingJacko
|
  |
| Joined: 20 Jun 2008 |
| Total Posts: 3944 |
|
|
| 31 Mar 2015 05:28 PM |
yeah i figured that out right after post but gun still doesnt move in first person.
I think its Mouse.Move
Should i store the mouse.Y value as a numbervalue and then use value.changed? |
|
|
| Report Abuse |
|
|
Tuneable
|
  |
| Joined: 16 Feb 2013 |
| Total Posts: 2932 |
|
|
| 31 Mar 2015 05:29 PM |
| In first person your mouse is locked in the center so this won't work for it. |
|
|
| Report Abuse |
|
|
| |
|
KingJacko
|
  |
| Joined: 20 Jun 2008 |
| Total Posts: 3944 |
|
|
| 31 Mar 2015 05:37 PM |
| How? The wiki didnt really teach me anything other than its the distance between mouse positions. |
|
|
| Report Abuse |
|
|
|
| 31 Mar 2015 05:42 PM |
http://www.roblox.com/games/217728333/Broken-first-person
Broken as in the gun positioning is horridly bad The code for camera movement is gold. |
|
|
| Report Abuse |
|
|
|
| 31 Mar 2015 05:46 PM |
| Wait what the hell was I doing there that code is garbage and it doesn't even work I need to go to an older version hang on. |
|
|
| Report Abuse |
|
|
| |
|
KingJacko
|
  |
| Joined: 20 Jun 2008 |
| Total Posts: 3944 |
|
|
| 31 Mar 2015 05:49 PM |
| I still cant find what im supposed to be looking for |
|
|
| Report Abuse |
|
|
|
| 31 Mar 2015 05:54 PM |
To make one that is the same for all clients you have to take, in fact, the total size, The code isn't 100% mine but I did do a great deal of it.
This code for some reason doesn't work and is all you need
local userInput = game:GetService("UserInputService") local player = game.Players.LocalPlayer local camera = workspace.CurrentCamera local mouse = player:GetMouse() local character = player.CharacterAdded:wait()
local root = character:WaitForChild('HumanoidRootPart') local torso = character:WaitForChild('Torso') local head = character:WaitForChild('Head') local rarm = character:WaitForChild('Right Arm') local larm = character:WaitForChild('Left Arm') local neck = torso:WaitForChild('Neck') local rotx,roty = 0,0 local sensitivity = .3 local sens = sensitivity local oldDeltaY = 1 local oldDeltaX = 1
head.CanCollide = false mouse.TargetFilter = character camera.CameraType = Enum.CameraType.Scriptable camera.FieldOfView = 70 userInput.MouseIconEnabled=true userInput.MouseBehavior=Enum.MouseBehavior.LockCenter
game["Run Service"].RenderStepped:connect(function() sens=camera.FieldOfView/sensitivity camera.CoordinateFrame=CFrame.Angles(0,roty,0)*CFrame.Angles(rotx,0,0)+(torso.Position+Vector3.new(0,1.5,0)) neck.C1=camera.CoordinateFrame:toObjectSpace(torso.CFrame) end) userInput.InputChanged:connect(function(inputObject) if inputObject.UserInputType == Enum.UserInputType.MouseMovement then local xmove = rotx + math.rad((-inputObject.Delta.y/mouse.ViewSizeY)*sens) local ymove = (roty + math.rad((-inputObject.Delta.x/mouse.ViewSizeX)*sens))%(2*math.pi) rotx = math.min(math.max(xmove,-math.pi/2+.1),math.pi/2-.1) roty = ymove end end) mouse.WheelForward:connect(function() sensitivity=math.min(sensitivity+.1,.8) end) mouse.WheelBackward:connect(function() sensitivity=math.max(sensitivity-.1,.1) end)
|
|
|
| Report Abuse |
|
|
KingJacko
|
  |
| Joined: 20 Jun 2008 |
| Total Posts: 3944 |
|
| |
|
|
| 31 Mar 2015 05:57 PM |
| Okay nvm all you need is what I just saved, the problem is that it doesn't move for some reason. I guess when I went from my awful testing to that I changed something. Wont be too hard to fix it just gotta find things that cancel out |
|
|
| Report Abuse |
|
|
|
| 31 Mar 2015 06:00 PM |
| Okay the problem is simply that you have to die before it to work, I'm sure you can fix that. |
|
|
| Report Abuse |
|
|
KingJacko
|
  |
| Joined: 20 Jun 2008 |
| Total Posts: 3944 |
|
| |
|
| |
|
KingJacko
|
  |
| Joined: 20 Jun 2008 |
| Total Posts: 3944 |
|
|
| 31 Mar 2015 06:25 PM |
| I thought i was close too :( |
|
|
| Report Abuse |
|
|
|
| 31 Mar 2015 06:32 PM |
| Go to starterplay and make the camera normal again see what happens |
|
|
| Report Abuse |
|
|
KingJacko
|
  |
| Joined: 20 Jun 2008 |
| Total Posts: 3944 |
|
| |
|