VR Hands - trying to get a smooth render || Question

what if I removed the motors - then applied the networkownership to base parts and got the local to render the cframe to vr service? would the base parts be recognised?

NOTE
I DON’T want to use Align Instances to each hand the physics applied aren’t even smooth upon replication.

Server

local module = {}


function module:SetNetworkOwnership(player, character)
	
	-- //for loop
	for _, Motor6D in ipairs(character:GetDescendants()) do
		if Motor6D:IsA("Motor6D") and Motor6D.Name ~= "RootJoint" and Motor6D.Name ~= "Left Hip" and Motor6D.Name ~= "Right Hip" then
			
			Motor6D:Destroy()
			
			local BasePart = Motor6D.Part1
			
			BasePart:SetNetworkOwnership(player)
			
		end
	end

end

return module

Client

-- //Services
local VRService = game:GetService("VRService")
local Players = game:GetService("Players")
local RunService = game:GetService("RunService")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Camera = workspace.CurrentCamera

-- //Folders
local RemoteEvents = ReplicatedStorage:FindFirstChild("RemoteEvents")

-- //Remotes
local VRServiceEvent = RemoteEvents:FindFirstChild("VRService")

-- //Character
local character = script.Parent.Parent

-- //Player
local player = Players:GetPlayerFromCharacter(character)

-- //Humanoid
local Humanoid = character:FindFirstChild("Humanoid")

-- //Character BaseParts
local Head = character:FindFirstChild("Head")
local RightArm = character:FindFirstChild("Right Arm")
local LeftArm = character:FindFirstChild("Left Arm")

function UserCFrame()
	
	-- //VRService CFrames
	local HeadVR = VRService:GetUserCFrame(Enum.UserCFrame.Head)
	local RightVR = VRService:GetUserCFrame(Enum.UserCFrame.RightHand)
	local LeftVR = VRService:GetUserCFrame(Enum.UserCFrame.LeftHand)
	
	Head.CFrame = Camera.CFrame * HeadVR
	RightArm.CFrame = Camera.CFrame * RightVR:ToWorldSpace(CFrame.Angles(math.rad(90), 0, 0))
	LeftArm.CFrame = Camera.CFrame * LeftVR:ToWorldSpace(CFrame.Angles(math.rad(90), 0, 0))
	
	
end

RunService.RenderStepped:Connect(UserCFrame)

now would this work? if not thas fine.

also i dont want to use remote events THEY suck.

Using UnreliableRemoteEvents would probably be the best way to handle the replication. Although you may not like remotes, they allow for much finer control over how your systems will be handled (rather than letting the physics system handle it).

Here’s how it’d work:

Server:

  • On receiving a client’s data, store it in a dictionary with they key being the player
  • Send and clear that dictionary of data every 1 tenth of a second to all clients

Client:

  • Send left and right hand CFrames in a list every 1 tenth of a second
  • On receiving the server data, update target positions for each hand and interpolate towards them every frame

welp thanks i guess, ill use the remotes

I just added more information on how I’d handle it

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.