Best way to show client on the server?

I am making a VR game, and right now the hands are handled on the client, what is the most accurate way to show these hands on the server as the VR player moves them with the least amount of delay?

1 Like

use remote events such as:

--example
--localscript
event:FireServer()

--serverscript
event.OnServerEvent:Connect(function(player)
    --your code
end)
2 Likes

or remote functions:

--example
--localscript
event:InvokeServer()

--serverscript
event.OnServerInvoke = function()
    --your code
end
1 Like

But I would have to send the hands cframe over?

Ok then inside firesrrver do this

event:FireServer(Instance.CFrame)

I got this now, how do I update those values? The server doesn’t even know those arms exist they can’t even see them.

Client:

		local remoteEvent = game.ReplicatedStorage.UpdateCFrames
		rightHand:GetPropertyChangedSignal(CFrame):Connect(function()
			local newRPos = rightHand.CFrame
			print(newRPos)
			remoteEvent:FireServer(newRPos)
		end)
		leftHand:GetPropertyChangedSignal(CFrame):Connect(function()
			local newLPos = leftHand.CFrame
			print(newLPos)
			remoteEvent:FireServer(newLPos)
		end)
	end

Server: 


local ReplicatedStorage = game.ReplicatedStorage
local remoteEvent = ReplicatedStorage.UpdateCFrames

local function updateHands(newRPos, newLPos)
	
end
1 Like

No no no make your righthand var a global variable like this and the left hand

local rightHand
[your function]
rightHand = [code]

I will show you an example of your code

Yeah, because I don’t understand what you just said

Here

local newRPos
local newLPos
rightHand:GetPropertyChangedSignal(CFrame):Connect(function()
    newRPos = rightHand.CFrame
end)

leftHand:GetPropertyChangedSignal(CFrame):Connect(function()
    newLPos = leftHand.CFrame
end)

remoteEvent:FireServer(newRPos, newLPos)

--serverscript
remoteEvent.OnServerEvent:Connect(function(player, rPos, lPos)
    --your code
end)
1 Like

I take it I don’t need the loop right?

No it just fires instantly but for security you can add it inside the leftHand and Righthand functions for better working script

The server can’t even see the arms so wouldn’t I have to send those over first or shouldn’t that work when this is executed

What do you mean by that I need more info

Is it a model? the hands or no?

It is a part made from a instance

	local function createHand(handType)
		local hand = Instance.new("Part")
		hand.Parent = character
		hand.CFrame = character.HumanoidRootPart.CFrame
		hand.Size = Vector3.new(0.4, 0.4, 1)
		hand.Transparency = 0
		hand.Color = Color3.new(1, 0.72, 0.6)
		hand.Material = Enum.Material.SmoothPlastic
		hand.CanCollide = false
		hand.Anchored = true
		hand.Name = handType
		return hand
	end

	local leftHand = createHand("rightHand")
	local rightHand = createHand("leftHand")
1 Like

Can you show me what the hand looks like when you play?

Okay brb let me just join on vr do you want to see it from client or server?

Both please and thank you :slight_smile:

Client:
image

Couldn’t get photo of server it was being weird but you can’t even see the arms from server

1 Like