Player clipping through floor in moving rocket

I am creating a moving rocket using BodyForce and tweening the speed in a server script to make it look like it goes faster as it speeds up. Players can enter the rocket as it takes off, however, this happens:

https://gyazo.com/ea9774d34e9f0d5c4bd81c4ccf2cb841

As it gets faster, players get flung out:

https://gyazo.com/5de960988618a4f1719d06e4fee2c07b

Is there anything I can do to avoid this? Any help would be appreciated. :smile:

1 Like

I can’t assure you this will work, because I would have to do the tests before claiming that, but maybe solution of this post could help. While the rocket is flying, maybe you can automatically correct character’s CFrame.

The fastest solution would be simply adding seats, and not letting player move around during the flight, but I don’t think that’s what you are looking for.

1 Like

Seats would not work as this isn’t a passenger rocket. It is a rocket robbery where players need to be moving about. I will have a look through that post.

1 Like

I tried the solution of that topic and this happens: https://gyazo.com/72c2ba71eb5497a790dbf4291511860d

EDITED
It looks like you should try to adjust only Y-axis and leave X- and Z-axis to player’s choice. Currently, player’s lower torso (or is it HumanoidRootPart?) position is continuously being corrected to rocket’s CFrame.

1 Like

Players need to be able to move and jump freely in the rocket ship.

Please excuse my late replying. I don’t know if the problem has been solved yet, but looks like with having enough velocity, a player will still be able to move through a wall. What you can also do is give players inside a rocket some upward directioned velocity.

1 Like

Since then I have come up with another solution that involves using prismatic constraints to move the rocket up and down. However, after a while players start bouncing around a lot and get flung and clip outside the rocket. Your solution sounds feasible but how would I know how much upward velocity to apply on players? I am using tweens so the amount would have to tween with the rocket.

For the solution created on my post, the platform the player is standing on must be cframed, or else it will not work. Just tween the rocket position and it should work as intended.

I did that too. Players shake a lot and they glitch through sometimes.

Has the code been placed into starter player scripts?

Yes the script is in StarterPlayerScripts.

Hmm very interesting, You wna add my discord and either screenshare or tc? LaAeroooo#4504

Sure. I am away from my computer right now but I can add you on discord.

It doesn’t let me add you. You’ll have to add me: Fondatix#5854

You can get the velocity of the rocket and apply the same value to each player.

https://developer.roblox.com/en-us/api-reference/property/BasePart/Velocity

I would really like to help, but don’t have much experience with body movement. I presume you tried using prismatic constraints like okeanskiy. The difference is that his elevator moves at a very slow speed, and doesn’t meet the problem with player’s physics. The elevator moves really smoothly at lower speeds though.

This is another post I found regarding the same issue, but solution in my first post was used.

1 Like

I have no problem with moving the rocket. Prismatic constraints work perfectly, however at high speeds players bounce a lot and get flung. I considered the velocity option however I wasn’t sure how much velocity I should put on the player, since the speed is tweened.

I don’t know about that. Using velocity, you could at least reduce the force with which player is pressing against the floor. Like you said, the main problem is constant speed growing, so you simply can’t achieve the wanted result this way. Technically, you could, but it would be very performance draining to update each client’s upwards velocity multiple times per milisecond. What you can do instead is test what happens when you get rocket velocity each second and see how it performs if you apply it to players less regularly.

How would I get the velocity of the rocket? Tweening doesn’t change the velocity.