Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How do you rotate arms along Y-Axis of mouse?

Questions says it all, basically a view model like in FPS games. Since CFrames aren't my thing(neither is math). How would you do it?

1 answer

local vec = (mouse.Hit.p-head.Position).unit
local pitch = math.atan2(vec.Y,vec.Z)

Arm.C0 =—[[CFrameOffset]]*CFrame.Angles(0,pitch,0)

Basic trig will do

This discussion is preserved as it was. New answers, comments, and votes are closed.