You can write your topic however you want, but you need to answer these questions:
- What do you want to achieve? Keep it simple and clear!
- I want my camera to not flip over whenever i look down or up.
- What is the issue? Include screenshots / videos if possible!
- What solutions have you tried so far? Did you look for solutions on the Developer Hub?
- I did but none were by my topic.
This is my code.
RunService.RenderStepped:Connect(function()
if CM then
local Mouse = P.Owner.Value:GetMouse()
Mouse.WheelForward:Connect(function()
workspace.CurrentCamera.CFrame = workspace.CurrentCamera.CFrame * CFrame.new(0, 0, -.01)
end)
Mouse.WheelBackward:Connect(function()
workspace.CurrentCamera.CFrame = workspace.CurrentCamera.CFrame * CFrame.new(0, 0, .01)
end)
if B2D then
UIS.MouseBehavior = Enum.MouseBehavior.LockCurrentPosition
local Delta = UIS:GetMouseDelta()
local limit = 80
workspace.CurrentCamera.CFrame = workspace.CurrentCamera.CFrame * CFrame.Angles(-math.rad(Delta.Y), -math.rad(Delta.X), 0)
else
UIS.MouseBehavior = Enum.MouseBehavior.Default
end
if W then
workspace.CurrentCamera.CFrame = workspace.CurrentCamera.CFrame * CFrame.new(0, 0, -.3)
end
if A then
workspace.CurrentCamera.CFrame = workspace.CurrentCamera.CFrame * CFrame.new(-.3, 0, 0)
end
if S then
workspace.CurrentCamera.CFrame = workspace.CurrentCamera.CFrame * CFrame.new(0, 0, .3)
end
if D then
workspace.CurrentCamera.CFrame = workspace.CurrentCamera.CFrame * CFrame.new(.3, 0, 0)
end
if E then
workspace.CurrentCamera.CFrame = workspace.CurrentCamera.CFrame * CFrame.new(0,.3,0)
end
if Q then
workspace.CurrentCamera.CFrame = workspace.CurrentCamera.CFrame * CFrame.new(0,-.3,0)
end
end
end)
I hope someone could help.