Camera Spinning

I’m trying to weld a camera to the cannon as a part of making a functional cannon, but it seems to keep spinning. I have no idea how to fix this

My script in StarterCharacterScripts:

RS = game:GetService("RunService")

local folder = game.Workspace.CannonFolder
local PositionStart = folder.StartPart
local End = folder.EndPosition
local direction = End.Position - PositionStart.Position


local camera = workspace.CurrentCamera

RS:BindToRenderStep("LockCamera",201, function()
	
	local CannonCFrame = folder.CFramePart
	camera.CameraType = Enum.CameraType.Scriptable
	camera.CFrame *= CannonCFrame.CFrame * CFrame.new(10,10,10)
	
end)

end ]]--```

here you’re adding these cframes

and since you never reset the cframe you’re endlessly adding those cframes and the camera will freak out. Try directly setting the cframe

camera.CFrame = CannonCFrame.CFrame * CFrame.new(10,10,10)
4 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.