Please Help | Question regarding physics, and anchoring

Right - so I’ll give some setup information first to try and describe the issue in a comprehensive an understandable way.

I’m working with a new experimental VR game in Roblox - and at its core I need to achive nice user-friendly physic interactions. But my only issue is - I don’t know any way of doing this. I can’t even think of a hacky half-measure way of achiving it. So I am hoping someone can help.

So firstly - I’ve made some very primative VR hands.
(The red outline is the servers updated location of the part)
(The solid block is the clients representation of where the part is)

My issue arisies from how floating parts interact with things physically.
When they are anchored, there is VERY bugy if not no interaction with unanchored parts.
(The ball is unanchored)
ANCHORED:

However when they are (ideally) unanchored - due to gravity they are just extremely incorrect. They’re all over the place and just don’t work as intended. However, physical interactions actually work propperly.
UNANCHORED:

The ONLY time I can get nice interactions to work, is when it is unanchored and EVERYTHING is handled on the client. This is still a little buggy (the arms tend to teleport down sometimes) and is not viable AT ALL due to the fact none of it is replicated.

Serverside Code:

REP.remotes.data_update.OnServerEvent:Connect(function(plr,data)
	local location = workspace.server_limbs:FindFirstChild(plr.Name)
	location.rightHand.CFrame = data[1]
	location.leftHand.CFrame = data[2]
end)

I’m assuming while the parts are unanchored you’re still moving them with CFrame? If it were me I would just use BodyMovers entirely, they are more physics friendly than CFraming at all.

Using BodyMovers will make the hands more realistic, having both collision and physics interaction. For example they won’t pass through solid objects, but can still move unanchored parts. Additionally the max force can be altered as a strength variable, so people can’t move a block with the mass of a mountain. BodyMovers make it just like a real life hand!

You could use collision groups to have them still pass through certain objects but that will require extra work.

This should be pretty easy to implement into your code:

  • Add a BodyPosition and update the Position property.
  • Insert a BodyGyro and update the BodyGyro.CFrame to be the CFrame rotation.

I am away from studio rn, I haven’t tested any of this but I do hope these help to some degree.

1 Like