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
4 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.

1local 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 4 years ago

Use VRService:GetUserCFrame

01local VRService = game:GetService("VRService"
02local Character = workspace.Andrew_KnowsRBLX
03local LeftHand = Instance.new("Part", Character)  
04local RightHand = Instance.new("Part", Character)    
05RightHand.Name = "Right Hand"
06LeftHand.Name = "Left Hand"
07RightHand.Size = Vector3.new(2.849, 5.359, 2.614)  
08LeftHand.Size =  Vector3.new(2.849, 5.359, 2.614)
09RightHand.CFrame = VRService:GetUserCFrame(Enum.UserCFrame.RightHand)
10LeftHand.CFrame = VRService:GetUserCFrame(Enum.UserCFrame.LeftHand)
Ad

Answer this question