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 » Scripters
Home Search
 

Re: Mouse.Y in scale?

Previous Thread :: Next Thread 
KingJacko is not online. 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 is not online. Tuneable
Joined: 16 Feb 2013
Total Posts: 2932
31 Mar 2015 05:17 PM
Mouse.Y / Mouse.ViewSizeY
Report Abuse
KingJacko is not online. KingJacko
Joined: 20 Jun 2008
Total Posts: 3944
31 Mar 2015 05:18 PM
thx
Report Abuse
KingJacko is not online. 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 is not online. 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 is not online. 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 is not online. 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
MrJoeyJoeJoey is not online. MrJoeyJoeJoey
Joined: 20 Aug 2011
Total Posts: 20787
31 Mar 2015 05:30 PM
use mouse delta
Report Abuse
KingJacko is not online. 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
MrJoeyJoeJoey is not online. MrJoeyJoeJoey
Joined: 20 Aug 2011
Total Posts: 20787
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
MrJoeyJoeJoey is not online. MrJoeyJoeJoey
Joined: 20 Aug 2011
Total Posts: 20787
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
MrJoeyJoeJoey is not online. MrJoeyJoeJoey
Joined: 20 Aug 2011
Total Posts: 20787
31 Mar 2015 05:47 PM
Fixed
Report Abuse
KingJacko is not online. 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
MrJoeyJoeJoey is not online. MrJoeyJoeJoey
Joined: 20 Aug 2011
Total Posts: 20787
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 is not online. KingJacko
Joined: 20 Jun 2008
Total Posts: 3944
31 Mar 2015 05:55 PM
maybe targetpoint?
Report Abuse
MrJoeyJoeJoey is not online. MrJoeyJoeJoey
Joined: 20 Aug 2011
Total Posts: 20787
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
MrJoeyJoeJoey is not online. MrJoeyJoeJoey
Joined: 20 Aug 2011
Total Posts: 20787
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 is not online. KingJacko
Joined: 20 Jun 2008
Total Posts: 3944
31 Mar 2015 06:08 PM
not in first person D:
Report Abuse
MrJoeyJoeJoey is not online. MrJoeyJoeJoey
Joined: 20 Aug 2011
Total Posts: 20787
31 Mar 2015 06:21 PM
That hard to do.
Report Abuse
KingJacko is not online. KingJacko
Joined: 20 Jun 2008
Total Posts: 3944
31 Mar 2015 06:25 PM
I thought i was close too :(
Report Abuse
MrJoeyJoeJoey is not online. MrJoeyJoeJoey
Joined: 20 Aug 2011
Total Posts: 20787
31 Mar 2015 06:32 PM
Go to starterplay and make the camera normal again see what happens
Report Abuse
KingJacko is not online. KingJacko
Joined: 20 Jun 2008
Total Posts: 3944
01 Apr 2015 09:30 AM
anyone have ideas?
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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