Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Camera manipulation doesn't work correctly?

Asked by 4 years ago

So my game is just a VR Test, and when my LocalScript sets the camera for a VR user, it doesn't work. It just locks on to the player. How can I stop this? Thanks!
PS: This ONLY happens for VR People.

local Player = game.Players.LocalPlayer
local Character = Player.Character or Player.CharcterAdded:wait()
local Camera = workspace.CurrentCamera
if game:GetService("VRService").VREnabled then
    if workspace.VRServer.AlreadyVR.Value then Player:Kick("There is already a VR person in here!") end --I know this causes problems. I'll fix it in the future.
    repeat wait()
        Camera.CameraType = Enum.CameraType.Scriptable
    until Camera.CameraType == Enum.CameraType.Scriptable
    workspace["Waiting for a VR User..."].Head.Accessory.Handle.Transparency = 1
    repeat wait() Camera.CFrame = CFrame.new(0, 0, 0) until Camera.CFrame == CFrame.new(0, 0, 0)
    script.Parent.ScreenGui.Enabled = false
    script.Parent.hide.Enabled = false
end

Answer this question