Hello, i’m trying to do aiming by Camera.CFrame = AimPart.CFrame. I got a problem that i cannot move mouse while aiming
.update: in first person i just randomly rotating with no reason
Code:
RunService.Stepped:Connect(function()
if Equipped == true and Hold2 == true or Hold2 == false then
if Hold2 == true then
UserInputService.MouseBehavior = Enum.MouseBehavior.LockCenter
camera.CameraType = Enum.CameraType.Scriptable
camera.CFrame = Tool.AimPoint.CFrame
elseif Hold2 == false then
camera.CameraType = Enum.CameraType.Custom
end
end
end)
Video:
Video2:
I’m trying to move mouse to a left or right but it didn’t work.
Maybe I don’t understand something. but I would really appreciate help solving this problem
CameraOffset is relative to the Character HumanoidRootPart, you need to get the Offset between the Head CFrame and the AimPart CFrame. And then set the Humanoid CameraOffset to ThatCFrame.Position.
local Offset = Head.CFrame:toObjectSpace(AimPart.CFrame)
Humanoid.CameraOffset = Offset.Position
Check the first video. I hope it will be clearer what I mean.
Result i have with your script (I have moving arms script btw but i checked without it and its not what i need)