Hello, im making a flashlight for a horror game like the old one looks bad.
Im having issue with the brand new one that im using viewmodel for it.
When my camera attach to fakecamera the viewmodel follows the camera too.
Example:
code =
Equip:Play()
Equip.Stopped:Connect(function()
Idle:Play()
end)
clone.PrimaryPart.CFrame = cam.CFrame
local oldCamCF = CFrame.new()
l = rs.RenderStepped:Connect(function()
local newCamCF = clone.CameraBone.CFrame:ToObjectSpace(clone.HumanoidRootPart.CFrame)
if oldCamCF then
local _,_,z = newCamCF:ToOrientation()
local x,y,_ = newCamCF:ToObjectSpace(oldCamCF):ToEulerAnglesXYZ()
cam.CFrame = cam.CFrame * CFrame.Angles(x,y, -z)
end
oldCamCF = newCamCF
clone.PrimaryPart.CFrame = cam.CFrame
end)
If you can help, thanks so much.