-
What do you want to achieve? I want the camera to go to the player’s head.
-
What is the issue? The camera keeps glitching out.
https://gyazo.com/e30eb2f1e7023c6636f761a01b26e681
also i can’t even turn and when i try it doesn’t work and when i look up and down it keeps doing that. another glitch it that it turns like a sawblade. -
What solutions have you tried so far? Searched google, didn’t even come up with useful knowledge.
this is the script
local player = game:GetService("Players").LocalPlayer
local c = require(player:WaitForChild("PlayerScripts"):WaitForChild("PlayerModule")):GetControls()
local char = player.Character or player.CharacterAdded:Wait()
local cam = game:GetService("Workspace").CurrentCamera
cam.HeadLocked = false
cam.CameraType = Enum.CameraType.Scriptable
local UserInputService = game:GetService("UserInputService")
local headCFrame = UserInputService:GetUserCFrame(Enum.UserCFrame.Head)
--renderCFrame = workspace.CurrentCamera.CFrame * headCFrame
UserInputService:RecenterUserHeadCFrame()
UserInputService.InputChanged:Connect(function(input)
if input.KeyCode == Enum.KeyCode.Thumbstick1 then
local position = input.Position
char:WaitForChild("Humanoid"):Move(position)
end
end)
game:GetService("RunService"):BindToRenderStep("TrackHead", Enum.RenderPriority.Camera.Value, function()
game:GetService("StarterGui"):SetCore("VRLaserPointerMode", 0)
game:GetService("StarterGui"):SetCore("VREnableControllerModels", false)
cam.CFrame = char.HumanoidRootPart.CFrame * UserInputService:GetUserCFrame(Enum.UserCFrame.Head)
c:Disable()
end)