local VRService = game:GetService("VRService")
local Players = game:GetService("Players")
local localPlayer = Players.LocalPlayer
if VRService.Enabled then
print(localPlayer.Name.." is using VR!")
else
print("no vr")
end
I ran this in a local script in StarterPlayerScripts
Keeps erroring with
This is the only thing I’ve been finding to detect if a players in in VR and I’ve literally copy pasted the code so I’m not sure why it’s not working. Anyone know what’s wrong?
It’s giving an error because the property is VREnabled and not Enabled. Also, I’m not sure that it matters, but the documentation uses UserInputService instead of VRService.
No problem. VRService does exist as seen in the article below, I just wasn’t sure if using the VREnabled property on one service over another made a difference. (In the VREnabled section they use UserInputService in the code sample which is what confused me.)