How can I make scripted suspension for a train?

Hello!

How could I make scripted suspension for a train?

Heres a video I found of how I want it to look

I’d prefer not to use raycast (I don’t think I’d need raycasts anyways considering the train won’t be driving over kerbs, speedbumps, bumpy roads, and more?)

I want it to look similar to the video provided above, higher speeds mean more bouncy, lower speeds mean less bouncy. I’d like to call this “Artifical Suspension” or “Fake Suspension” that looks real.

I found this video of a prototype that could be useful to me
https://twitter.com/BuilderAtWork_/status/940284689377628160 from this devforum post I found How can i script a train suspension with vertical wobble etc

Thanks in advanced for any help

1 Like

Bumpy bump, its been 11 hours since i posted this and this is something i really want to do.

I’d just make a suspension that works as is. Then use a script to figure extra motion.

I wouldn’t know what im scripting, am I scripting the 2 attachments that hold the suspension? I also don’t know how I’d randomize how high the suspension should bounce or in a smooth way

Suspensions = springs no other way around it as thats where the real life thing is based upon.

Either use Roblox physics constraint springs or make your own if you are using CFrames.

If you are using your own then you can look into spring modules.

An extra bit of info is that you can replace the linear acceleration terms and displacement with angular terms instead to get that angular suspension tilt feel.

Guess till you figure it out.

local rnd=math.random(1, 10)

This will only pick from 1 - 10 … so figure your low and high and input that.
I agree with this: Suspensions = springs. This should be most of your motion right there if not all of it.
That is a really good link btw dthecoolest. I’ve studied that page myself.

1 Like

Thanks, I’ll have a look when I get home. I’ll send a reply when/if I have any questions

I know how to get random numbers, but don’t know how I’d make it adjust like a smooth spring affect. Nor would I know what I’m adjusting.

I’ll take a look at the link that dthecoolest posted and I’ll come back here if needed.

The setting on the springs is what you would adjust. This is one of them things you just need to keep guessing/messing with till you find your sweet spot. You should be fine using that page’s information.

So I’m using Roblox physics for my train system, I’ve tested using SpringConstrains combined with CylindricalConstraints for the purpose of letting the train turn but doesn’t really bounce while moving, and I’ve messed around with it for ages but can’t really get it to bounce while moving at speed, the only time it seems to bounce is when I adjust the springs properties.

I could send you a model (with tracks of course) if you’d like to take a look for yourself.

You know you could add some camera movement to that, while the train is moving.

Thats actually a really good idea and all, but I want it to look real from the outside and walking around the inside aswell.

I might just leave the suspension till later on in the system, and work on the more simpler and easier things I want to done… because I’m too lazy (and it gets boring) to keep messing around with properties for hours and get nowhere.