I know this will be hard to do, and may come off as a request. But, I did try some things to start off. To give you some insight, I have a gun that when you press down right click the gun "zooms in" or plays a animation to make it look like you are zooming in. But, there is one issue, when you look up and down, the gun and your arms stay locked in place to that one animation. I'm trying to have it move up and down with your mouse. This Is the script I have so far, that gets the mouse's position. I was thinking I could use like CFrame.new to change the arms to that certain position, but I'm not sure. Anything could help? Here is the script so far:

local Player = game.Players.LocalPlayer 
local LeftArm = game.Players.LocalPlayer.Character.Humanoid.LeftArm
local RightArm = game.Players.LocalPlayer.Character.Humanoid.RightArm
local Mouse = Player:GetMouse()
local MouseCFrame = Mouse.Hit
local MousePosition = MouseCFrame.p
print (MousePosition)
LeftArm.CFrame.new.Postion = MousePosition
RightArm.CFrame.new.Position = MousePosition

Of course, I tested this and it didn't work, but I know there is a lot to it. I just made this to kind of show what I'm at right now for this issue. Also, I'm using an R6 character for my game. Anything helps! -Mrmonkeyman120

3 comments

0

I don't know for sure but this may be able to help. https://developer.roblox.com/api-reference/function/Camera/WorldToScreenPoint

0

Hmm interesting, I'll take a look.

0

I got one, Make a localscript and put it into your starterpack, use this code: