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

How do i make a VR script, Im trying to get the controller positions and the headset position?

Asked by
3F1VE 257 Moderation Voter
3 years ago

Im making a VR script for fun all i want to know is how do i get the right/left controller positions? i made the hand's If you dont know do not respond to this question.

 local vr = game:GetService("VRService")  local hand1 = Instance.new("Part",workspace.Andrew_KnowsRBLX)   local hand2 = Instance.new("Part",workspace.Andrew_KnowsRBLX)  hand1.Name = "Right Hand" hand2.Name = "Left Hand" hand1.Size = Vector3.new(2.849, 5.359, 2.614)   hand2.Size =  Vector3.new(2.849, 5.359, 2.614))

1 answer

Log in to vote
1
Answered by 3 years ago

Use VRService:GetUserCFrame

local VRService = game:GetService("VRService")  
local Character = workspace.Andrew_KnowsRBLX
local LeftHand = Instance.new("Part", Character)   
local RightHand = Instance.new("Part", Character)     
RightHand.Name = "Right Hand" 
LeftHand.Name = "Left Hand"
RightHand.Size = Vector3.new(2.849, 5.359, 2.614)   
LeftHand.Size =  Vector3.new(2.849, 5.359, 2.614)
RightHand.CFrame = VRService:GetUserCFrame(Enum.UserCFrame.RightHand)
LeftHand.CFrame = VRService:GetUserCFrame(Enum.UserCFrame.LeftHand)
Ad

Answer this question