Ad
Still have questions? Join our Discord server and get real time help.
Log in to vote
0

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

Asked by 7 days 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
TTChaos 200 Moderation Voter
7 days 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