What are you attempting to achieve? (Keep it simple and clear)
I want the train not to shake when someone boards it. I am scaling Scottifly’s model of a rail cart to a larger train model, so credits to them.
What is the issue? (Keep it simple and clear - Include screenshots/videos/GIFs if possible)
A player entering will cause the train to shake. It will shake for about 45 seconds and then settle down.
Here is what happens to the wheels after I board the train:
What solutions have you tried so far? (Have you searched for solutions through the Roblox Wiki yet?)
Yes, I have tried looking for solutions. I increased the density of the wheels to the highest value (100), it made the situation better since it used to shake violently without touching the train. I also tried increasing and decreasing the masses of parts.
If there is more information needed to answer the question, I will happily provide it!
If you want to mention someone in a post you should put an @ in front of their name. I just happened to see this post…
Increasing the Density of one side of a Constraint may make the physics unbalanced. Try keeping both sides of Constraints the same Density.
I probably made the yellow centering wheels a little smaller than they needed to be, but I think I was using curved sections of track that angled about 15 or 20 degrees. You may want to increase the size of the centering wheels until they are about .05 studs narrower than the inside measurement of the track.
Is it only the one train car that’s shaking, or both?
What is the Density of the rest of your train Parts?
That is a clever workaround, I’ll have it as a last resort solution if all my efforts will not work. For now, I will be looking at Scottifly’s or other responses and try to fix the root of the problem.
Is your player sitting while this is going on?
I’ve found most physics objects don’t like when there is a player walking around on them unless they have more Density than the Humanoid.
I tried uploading a clip but it didn’t work. Both cars shake when the players enter, but interestingly enough, only the first car shakes on turns. The second back car runs the curve extra smooth.
The density of all the train parts vary. This is because I did not do CustomPhysicalProperties on about 95% of the parts. I did make the 3 heaviest unions on each carriage massless (had masses of about 33300, 15600, 13000). A majority of the body (~80%) is smooth plastic, which has a density of 0.7 if I am not mistaken.
When the player enters and stands in the carriage, the carriage slightly shakes and the player starts drifting slowly towards a certain direction.
When sitting, there is no shaking. That is strange, since whenever the player gets on the train and then goes out to check the wheels, the train is visibly shaking from the wheels, but shaking stops when sitting in the train.
You mentioned unions, so be sure your unions have Collision Fidelity on PreciseConvexDecomposition (or in some cases Hull), so that you do not get unseen/unwanted collisions going on (with the track or the other train parts).
I’ve had lots of vehicles where the player is moved across the surface when the vehicle stops. It has to do with the Part’s internal AssemblyLinearVelocity and AssemblyAngularVelocity Properties. It acts like a Conveyor belt if the Property isn’t set to 0,0,0. I’ve actually used a script that detects when a player leaves the VehicleSeat, waits a second or so, then resets the Linear and Angular Velocities to 0,0,0.
@RMofSBI Collisions shouldn’t be an issue in this case, since the train cars don’t wobble when the player is off the surfaces. Collisions can be checked using the Settings > Physics > Show Collisions tool, which shows a red ball wherever a Physical collision occurs.
Perhaps the issue is that each of the wheel models (bogies) has a hinge constraint attached to the bottom of the train floor. I placed a hinge since if the bogey models could not turn, it would cause the train to get stuck on turns (since the carriages are long and need two of them). Might this be part of this issue?
The wheels I used don’t have a flange, so they don’t need to be centered and ‘stuck’ because of it.
As you can see from my model, the track turns 15 or 20 degrees (I can’t remember which now) with no issues.
I suspect that if you make the weight of the cars and the center of gravity of the heavier cars higher it’ll cause more issues with Roblox physics. If you keep the heavier car frames and wheels all the same Density and use Massless Parts and MeshParts welded to it as the decorations it’ll keep the car’s center of gravity lower and lighter.
I will mark this as the solution since this actually significantly reduced the shaking where it is now almost unnoticeable. This does cause another issue though, and the issue is that the train now starts to tip over on curves. I am assuming that maybe I should increase the density of one of the lower parts? Or do something else.
Decrease the mass of any Parts (or make them Massless) above the height of the train wheels. If you need to add a Dense Part lower then that should work fine.