Attaching players to moving physics-based parts

Hey there, I’m currently trying to make a fully physics-based ship system, so no tweening or other CFrame movement, just LinearVelocity, etc.

The problem is, players can’t stand/walk/jump steadily on ships at higher speeds. @EgoMoose’s wall stick/gravity controller was getting me close, but it creates other weird issues that don’t make it a viable solution in this case.

I know that this is easier when the part is simply tweened, since players standing on tweened parts don’t get dragged along with them, so a solution like this one would work perfectly fine. The problem is that here, the physics of the moving ship already act on the player. So the two possible solutions I can see are:

  • Somehow remove the force that moving ships apply on the player, and calculate the rest as if the ship was being tweened

  • Some other system of the likes of EgoMoose’s module that can have players moving relatively to the ship

  • Ditching physics based ships for CFrame instead (preferably not since I’d have to scrap most of what I’ve made so far, but lmk if you think this is the only option)

If you have any idea on how to achieve the points I’ve mentioned, or if you have any other ideas, any help would be appreciated.

1 Like

Bumping to try to get new people to see this. Even if you’re not entirely sure, please let me know of any ideas, I’m quite desperate at this point.

Could you show what you mean by this? I’m trying to understand how this force would affect the player when using the solution in the mentioned link.

Yeah it’s a bit weird but it makes sense when you try it firsthand. Unfortunately I’m not home to recreate this setup, however what would happen is that the script updates your position relative to the ship, but so does Roblox’s physics (the force that usually keeps you standing on moving parts fairly reliably). This means that you end up with two systems trying to move you to the correct relative position, and so you move twice too far every frame.

The script linked above moves you relatively to your current position, while adding the ship’s movement. So it’s not positioning you relatively to the ship, it’s positioning you relatively to you, hence why it’s also affected by Roblox’s physics (at least that’s what I gathered from my testing).

This is why another possible solution would be a system that moves you entirely relatively to the ship, while using a more accurate method to calculate the character’s movement. This essentially means making your own character controller from scratch, and I wasn’t willing to attempt that. Just movement is fine, but then jumping is also necessary, so are collisions, and that just becomes a mess. You’d basically be welding the character to the ship, and calculating the C0 based on the player’s input.

Bumping to get fresh eyes on this post

Well thats very weird, but if the issue is being offseted doubly then maybe u can derive some kind of a “next position” for the character based off the boat’s velocity and calculate where they should end up based on that and then just cframe them to that position?

Yeah, that’s what I mentioned in that last paragraph, but then I need a way to get the player’s intended movement. This also means having some custom system for collisions, since we would no longer be moving characters with Roblox’s controller.

saw this a while ago, maybe this could be useful to you?

That’s not really what I’m looking for, the post you linked is for tweened objects, the ships in my case use physics.

However you’ve made me poke around some more, and I’ve never actually picked up on the fact that network ownership was the issue. Roblox seems to handle everything fine till two players are involved. Here’s a little demonstration:

External Media

As a reminder, if a player owns the assembly it’ll be highlighted in their colour. You can see that whoever has network ownership can walk fine across the ship, even while moving, whereas whoever doesn’t have it will slide around and get flung.

Nice to know but it doesn’t exactly give me much insight. Any ideas would be appreciated.