of     1   

eqis
#170666485Monday, August 10, 2015 7:45 PM GMT

Don't suppose anyone knows of a way to make a gun move up and down with the cursor in first person mode?
M4LLARD
#170666565Monday, August 10, 2015 7:46 PM GMT

Some people to know how to, yes.
eqis
#170666794Monday, August 10, 2015 7:48 PM GMT

I know some people do, that's why I'm asking.
M4LLARD
#170667160Monday, August 10, 2015 7:51 PM GMT

You asked if people knew a way. I answered that.
eqis
#170667385Monday, August 10, 2015 7:53 PM GMT

Perhaps if you used common sense you'd realise I wanted an answer to my question, not you telling me that there is someone in our corporeal plane that has the knowledge.
PearSprite
#170667698Monday, August 10, 2015 7:56 PM GMT

Step 1: Get player's mouse Step 2: Get height of screen (obtainable through camera.ViewportSize.h) Step 3: Get y position of mouse in a move event Step 4: Use the following formula to get the degrees in radians that you should rotate the tool on the desired axis: radians = math.rad( 45 ) * ( ( -( camera.ViewportSize.Y / 2 - y ) )/ camera.Viewport.Size.Y )
PearSprite
#170667811Monday, August 10, 2015 7:57 PM GMT

Oops, divide by camera.Viewport.Y/2 not camera.Viewport.Size.Y
Casualist
#170667915Monday, August 10, 2015 7:58 PM GMT

For first person, you'll be doing everything with the camera's lookvector relative to the x-z plane.
PearSprite
#170667916Monday, August 10, 2015 7:58 PM GMT

Also, by camera.Viewport.H I meant camera.Viewport.Y
eqis
#170668062Monday, August 10, 2015 7:59 PM GMT

Thanks pear.
PearSprite
#170668084Monday, August 10, 2015 7:59 PM GMT

Also my formula only works for when you're not in first person, I'll leave it up to you to convert it.
PearSprite
#170669069Monday, August 10, 2015 8:08 PM GMT

Eh, I'll be nice: radians = math.rad( 45 ) * ( math.acos( mouse.Hit.lookVector:Dot( Vector3.new( 0, 1, 0 ) ) ) / math.pi - .5 )
PearSprite
#170669202Monday, August 10, 2015 8:09 PM GMT

Correction: radians = math.rad( 45 ) * -( math.acos( mouse.Hit.lookVector:Dot( Vector3.new( 0, 1, 0 ) ) ) / math.pi - .5 )
eqis
#170669514Monday, August 10, 2015 8:12 PM GMT

Pear, do you know how to get the Y from the mouse in first person?
PearSprite
#170669643Monday, August 10, 2015 8:12 PM GMT

^ The mouse is locked in the center of the screen in first person. See the 2nd formula I posted.
Casualist
#170669986Monday, August 10, 2015 8:15 PM GMT

@pear Why wouldn't you just use the camera's lookvector?
PearSprite
#170673250Monday, August 10, 2015 8:42 PM GMT

^ Because I don't want to have to type camera.CoordinateFrame.lookVector when I can type mouse.Hit.lookVector to do the same thing.

    of     1