Only use gyro rotation when zoomed close enough.

Roblox's camera is still hijacking signals and tricking my camera into
using first person mode when it isn't supposed to be. Trying to work
around this.
This commit is contained in:
CloneTrooper1019 2020-04-29 23:04:43 -05:00
parent 05b67445d1
commit 07ac5baeba
1 changed files with 16 additions and 4 deletions

View File

@ -33,13 +33,24 @@ spawn(function ()
end)
local function update()
local zoom = (c.Focus.Position - c.CFrame.Position).Magnitude
local rotationType = GameSettings.RotationType
local seatPart = humanoid.SeatPart
if rotationType.Name == "CameraRelative" and not seatPart then
local dir = c.CFrame.lookVector * xz
bg.CFrame = toRotation(dir)
local dir
if zoom <= 1.5 then
dir = c.CFrame.lookVector
else
bg.Parent = nil
end
if dir then
bg.CFrame = toRotation(dir * xz)
bg.Parent = rootPart
end
humanoid.AutoRotate = false
else
local state = humanoid:GetState()
@ -56,5 +67,6 @@ end
humanoid.AutoRotate = false
humanoid:SetStateEnabled("Climbing",false)
RunService.RenderStepped:connect(update)
RunService:BindToRenderStep("GoofyMotion", 400, update)
c.FieldOfView = 65