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)
its follow the camera but im trying to make like fps game that they don’t follow totally the camera while the fake camera is woking, its confusing but if you search some fps games like the reload animations the camera moves but not everything moves with the camera, but if you move the camera while reloading the viewmodel doesn’t follow the orientation totally its like its follow an origin. Its confusing i know.