task.wait(2)
local VrMode = false
local VRS = game:GetService("VRService")
local userInputService = game:GetService("UserInputService")
local player = game.Players.LocalPlayer.Character
local HeadScale = 1
local Cam = game.Workspace.CurrentCamera
if VRS.VREnabled == true then
VrMode = true
print("User is using a VR headset!")
Cam.HeadLocked = true
Cam.CameraType = Enum.CameraType.Scriptable
else
print("User is not using a VR headset!")
end
VRS.UserCFrameChanged:Connect(function(Part, move)
local HeadCFrame = VRS:GetUserCFrame(Enum.UserCFrame.Head)
if VrMode == true then
player.Head.CFrame = HeadCFrame + Vector3.new(0,5,0)
Cam.CFrame = player.Head.CFrame
if Part == Enum.UserCFrame.LeftHand then
local x,y,z = (Cam.CFrame * move ):ToOrientation()
player.LeftHand.Handle.AlignPosition.Position = (Cam.CFrame * move * CFrame.Angles(math.rad(0),math.rad(180),math.rad(270))).Position
player.LeftHand.Handle.AlignOrientation.PrimaryAxis = Vector3.new(math.deg(x),math.deg(y),math.deg(z))
elseif Part == Enum.UserCFrame.RightHand then
player.RightHand.Handle.CFrame = Cam.CFrame * move * CFrame.Angles(math.rad(0),math.rad(180),math.rad(90))
end
end
end)
local USR = game:GetService("UserInputService")
USR.InputBegan:Connect(function(input)
if input == Enum.KeyCode.ButtonL2 then
end
end)
The issue is align orientation is orientating correctly it works perfectly fine using CFrame
Just ask if you have any questions