Players not sticking to moving platform [2]

I made a similar thread yesterday - however due to lack of result and some terrible explaining(on my part); there was no sollution.

My underlying issue is

  • A platform being moved with BodyPosition and BodyGyros will not allow players to stick entirely to it. They will stay on top but slowly drift from their original position.

A quick breakdown of the game and current implementation
The game is based around a similar idea to Skeds VR Playgrounds - in which there are big users with VR sets who can interact with small users. In my implementation I do as follows:

  1. On VRService.UserCFrameChanged I move two parts locally to show as ‘hands’
  2. Right afterwards I fire the server with the location of these ‘hands’
  3. The server then updates a Body Position & Gyro to the location it is given
  4. The ‘sever hands’ are now synced with the client hands. With a slight delay.

Technical Details

  • The server hand is NetworkOwnership(nil)
  • The solid hands are entirely client-sided and have no impact on physics. They are just for tracking the controllers

As you can see, even though the dummy sticks to the hand (for the most part) - he is slowly drifting off until he eventually falls.

People told me it was impossible to get this to work perfectly, but that simply isn’t true. Because with the following code:
(script.Parent is a BodyPosition)

local a = script.Parent.Parent.Parent.a
local b = script.Parent.Parent.Parent.b
while wait(5) do
    script.Parent.Position = b.Position
    script.Parent.Position = a.Position

I get this (working) result:

What I don’t understand is why the lower result works but the top one doesn’t - they both do the exact same thing; which is updating the position of a body position.

Here is my code from the (top) image.

	local data = {rightHand.CFrame,leftHand.CFrame,head.CFrame}


    local location = workspace.server_limbs:FindFirstChild(plr.Name)
    location.rightHand.BodyPosition.Position = data[1].p
    location.rightHand.BodyGyro.CFrame = data[1]
    location.leftHand.BodyPosition.Position = data[2].p
    location.leftHand.BodyGyro.CFrame = data[2]
    location.head.BodyPosition.Position = data[3].p
    location.head.BodyGyro.CFrame = data[3]

Have you tries increasing the friction of the part in custom physical properties? Or maybe you can physically weld them on to the platform.

I’ve tried the first option, the second I’ve not really explored

Maybe consider a lower refresh rate for updating the location of where the VR hand is? Might be more delayed than prefered but it’ll ensure the player will stay on the hand more accurately as the many updates to Body Position might add the tiny micro amount of ‘float point errors’ to have a player slide off.

Maybe consider updating the position of the hand if the hand has moved more than a stud?

Maybe let the Roblox Server handle who owns the Network Ownership so whoever is standing on the hand will stay with it?

Neither works, though; I know there is some sollution to do it without rounding.

Skeds, in the game above executes it perfectly.

Have you tried giving the network ownership of the part to the player and then moving the part locally?

1 Like

Perhaps manually CFraming the dummy onto the platform will work. I use this system with a train in my game. The train is moved on the server-side and then a local script moves the client to keep it in the same relative position.

1 Like

You should be able to adapt that system to work with an NPC as well, as long as it also uses a Humanoid.

I did this and this worked perfectly. I would like to really credit you on your sollution.

And yes I know everybody is face-palming of why this wasn’t tried earlier and the main reason was because:

  • It broke any physical interactions - due to replication.

Thus my final sollution was:

  • Have the server hand :SetNetworkOwnership()'d to the VR Player, and then have a secondary invisible hand that cannot collide with players or the first hand; which is NetworkOwnership()'d to the server. One deals with player platforming and the other physics.

Its messy but it works.