How can I make players stick to moving parts?

I’m unsure what you could do, but I’ll throw some ideas your way. Maybe add a touch part, and whenever a player is on the vehicle, use a weld constraint on their primary part.

Wouldn’t that stop them from being able to walk around?

Yes, it would. You said you wanted the part to be unanchored and in motion?

Yeah. The part should be able to move around, since it’s part of a train. If a player stands on the train or in something the train is pulling, they should be able to stand and walk around without the risk of glitching and falling out onto the track.

The video posted by @SPR1NG3R should do the trick; forget about the tween service and get the train’s position or the part position that’s in motion.

@SPR1NG3R’s video is for anchored parts. The train is unanchored.

The only way to make players stick to moving parts is to use some sort of BodyMover on the part you want to move, like AlignPosition.

I’ll try that when I get the chance.

This can help you get started: (keep in mind BodyPosition is deprecated, so you may not want to use it)

have you made anything and tested this out? depending on how you are moving the train, if its unanchored then it would have linear velocity? I might be mistaken but.

1 Like

You can do some stuff with a Weld, though I haven’t tried anything yet.

I haven’t tried anything since I’ve been unable to find anything that would be easy to implement.

Welds would stop the player from moving. When on the train, I want them to be able to move around normally as if the train was idle, without glitches such as sliding off or jumping causing you to fly backwards.

You could artificially move the weld CFrame in their move direction.

1 Like

And how would I do that?

‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’

I’m not sure. It shouldn’t be too hard though, however the hard part may just be replicating it.

1 Like

I don’t think you’re gonna find an easy solution for this. There totally could be some built in Roblox method that I’m unaware of, but I think you’re best bet is truly to mess with the assembly linear velocity or some sort of other roblox physics method. or even custom physics. Nonetheless, I really don’t see you being able to find an easy solution to this. Also, if you are planning on making a game like that defend the train from thomas game, I think they just have the train standing still and the ground moving below them

1 Like

Dang, I’ll just forget about the idea then. Appreciate all the help, though.

Also, the game’s a train roleplay game, not an infinite-ride type game.

This should help achieve your goal:

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