I’m having some issues trying to get this animated camera to work.
It changes the movement of the camera based on the direction the camera is facing.
So far I’ve tried to use :ToObjectSpace(), :ToWorldSpace, and multiplying the offset CFrame by the camera’s CFrame. Those only seem to result in the camera either shaking rapidly or just floating around. Couldn’t find any topics of use. If you can find one, please let me know.
local camY = 0
local camX = 0
runServ.RenderStepped:Connect(function()
local charSpeed = math.round(char.PrimaryPart.Velocity.Magnitude, 1)
local thePos = vmCam.CFrame:ToObjectSpace(vmRoot.CFrame)
local ax,ay,az = thePos:ToOrientation()
local animOffset = CFrame.Angles(ax,ay,az)
local camAnimOffset = CFrame.Angles(-ax,-ay,-az)
local mdelta = inpServ:GetMouseDelta()
local headCF = CFrame.new(char.HumanoidRootPart.CFrame.Position) * CFrame.new(0,2,0)
camY -= mdelta.X
camX -= mdelta.Y
cam.CFrame = headCF * (camAnimOffset * CFrame.Angles(0,math.rad(camY),0))
folder.camAnchor.Weld.C0 = animOffset
camAnchor.CFrame = cam.CFrame*offsetCF*aimCF
The camera mode is set to scriptable.
I’m not very knowledgable on this CFrame stuff and wouldn’t exactly call myself a professional developer so I have no idea what to do about this. Apologies if this isn’t very clear or concise.