Hello, so I’m trying to make some kind of ‘arms’ script but this is just for testing, that’s why it’s clietnsided, so basically, when you’re on first person it works fine but if you’re on first person the part starts spinining if you move mouse
Here you can see a gyaoz of the trouble: https://gyazo.com/523ab96ba28e031c7f6035f9b8f83d67
local Arms = workspace.Arms
local cam = workspace.CurrentCamera
game:GetService('RunService').RenderStepped:Connect(function()
if cam then
if char:WaitForChild('Humanoid').Health > 0 then
local IsFirstPerson = (cam.CFrame.p - char.Head.Position).Magnitude <= 1
if IsFirstPerson then
Arms:SetPrimaryPartCFrame(cam.CFrame * CFrame.new(0,0,-5))
else
Arms:SetPrimaryPartCFrame(char.HumanoidRootPart.CFrame * CFrame.new(0,0,-3) * CFrame.Angles(math.rad(mouse.Y),0,0):Inverse())
end
end
end
end)
^ Code
Also quick question, what’s difference between object space and world space
You could try removing the math.rad() function that is around the mouse.Y. Also I dont know if this makes any difference, but instead of mouse.Y, I would do mouse.Hit.p.Y
World space is always the same, it never changes. Let’s say the position 0,0,0 in world space is always the center of the map, but in object space, it is the center of the object. If you move something relative to object space, it translates around the object itself and ignore the axis on world space. Let’s say you have one part, left in object space wouldnt be left for a part with another rotation, but it would all be the same in world space. Hope this helps