So right now I have basically a rough draft of a physic VR game. I encounter an issue with making the player move. I have made controllers using VR Service that when you move your hands IRL it moves the parts in-game AKA the controllers. When I move my character or camera, the controllers stay at Vector 0,0,0 but still responding to my movements IRL. (I am using Oculus Rift btw)
I want to get the controllers to stay with the character so when I walk or rotate it follows the Player and not stay at 0.
I tried doing this but the controllers are off and don’t rotate with the camera.
-- Local Script
VRService.UserCFrameChanged:Connect(function()
repeat wait() until Started -- Waits until game is loaded and VR is connected.
local cameraSpace = game.Workspace.CurrentCamera.CFrame
local HEAD = VRService:GetUserCFrame(Enum.UserCFrame.Head)
local RightHand = VRService:GetUserCFrame(Enum.UserCFrame.RightHand)
local LeftHand = VRService:GetUserCFrame(Enum.UserCFrame.LeftHand)
game.ReplicatedStorage.MovingHands:FireServer(HEAD,RightHand,LeftHand) -- Fires to a server script so that the hands and head move globally.
end)
-- Server Script
function MoveHands(Player, Head, RightHand, LeftHand)
game.Workspace.Hands:WaitForChild("Head").CFrame = (Head + Player.Character.Head.CFrame)
game.Workspace.Hands:WaitForChild("RightHand").CFrame = (RightHand + Player.Character.Head.CFrame)
game.Workspace.Hands:WaitForChild("LeftHand").CFrame = (LeftHand + Player.Character.Head.CFrame)
end
game.ReplicatedStorage.MovingHands.OnServerEvent:Connect(MoveHands)
So I gave up on that and made it so that it isn’t connected to the player. I set the camera to Vector 0,0,0 and it all works fine, the controllers are correctly positioned, but you can’t move. You can move the controllers and your “head” but you just can’t move position unless you do it IRL and move around your room.
This is my first time taking on VR stuff on Roblox is the service provides hardly any information. Hopefully, someone can solve this, thanks.