Monorail Script

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? I want to make a working monorail (or train to make it a little bit easier). What I want the train to do, is go back and forth on the platform I made. It would also be nice if it can gradually stop when it gets close to point A and point B.

  2. What is the issue? I have no clue how to make it :stuck_out_tongue:

  3. What solutions have you tried so far? Bunch of youtube videos.

Thank you guys so much for reading this!

This section is to help, no to give free scripts. If you need help then come with a script that isn’t working, and we are gonna try to “fix it”, help, give feedback, etc.

Anyway, if you want a script for a monorail, go to #collaboration:recruitment.

Thanks for reading and have a nice day! @Lil_SharkyBoy

You can use MoveTo(Model | Documentation - Roblox Creator Hub) to move the part(or the model), however using twinservices may work better for monorails.
There’s some ways to build that, but that’s on the #help-and-feedback:building-support place

If you want the script, then as @Lil_SharkyBoy said, you can post it at #collaboration:recruitment section(by recruiting a scripter)

I can’t hire anyone though, so…

MoveTo() is the worst way to achieve this, as it actually imprecisely moves the whole model to a point where none of the parts comes into touch with another.

Otherwise as said before, use the dev forum to recruit some scripters, maybe you find someone to do it for free.

You will have to use CFrames and most probably B-spline curves to achieve smooth movement. They are better than Bezier curves for some situations as modifying 1 segment won’t affect the entire shape, only its neighbors.

You can use this page to verify which type of a curve would be most appropriate for you.

http://nurbscalculator.in/

As for keeping the characters on the train (because CFrames don’t directly affect physics), you’ll also have to CFrame the characters.

One thing I’d also add is that instead of lerping the train at its center, you should use 2 central wheel segments for each wagon and then use the point between them to position the model itself. This way, it will look more realistic when making turns.

It doesn’t need to turn. It just goes back and forth.

Then the use of PrismaticConstraints might be essential.

In that case, define 2 points and use :Lerp between them. You can even use constraints if you want to avoid CFraming characters.

would you do it for free…? lol

I mean, there are already official Roblox tutorials on this.

Do body positions work for models?

The LeMonde People Mover, which I assume you are trying to copy (as you are in LMA), uses roblox’s constraints in a node-based fashion. Just a forewarning: it took a long time to code. I know you are probably inspired to us adding that to our new game, but it I just want you to know that it took long hours of hard work to do. That being said, I think it is a great idea. Good luck!

Wow. Can’t believe you are assuming things. I find that very offensive. Its just a decoration for the aiport my friend and I are making. It won’t be used to move people.

I saw you are in LMA, so I assumed it. I want people to make their own and I am happy you are. If you want to see how I did it, I can show you. Add me on discord MrBob101#8276

I am a founder of an airline. It’s called AirSmart. You should consider joining. 400+ members.

Nice! But as I and others said, your best way is either using constraints (if you want people to ride it), or if you don’t, you can use CFrame which might be a little bit easier. Make sure to weld the train to a single part and move that part. Good luck!

Can bodypositions move models?

Yes they can, although you said it’s just a deco, so CFrames will give a more consistent result.

local speed = 10 --studs per second
local p0 = Vector3.new(...) --first position
local p1 = Vector3.new(...) --second position
local p = 0 --current position from 0 to 1

local dir = 1 --used to move back and forth
local dist = (p1-p0).Magnitude --distance

local angcf = CFrame.new(p0,p1); angcf = angcf-angcf.Position --rotation CFrame
game:GetService("RunService").Heartbeat:Connect(function(dt)
    p = math.clamp(p+dt*speed*dir/dist,0,1) --advance
    if p==0 or p==1 then dir = -dir end --turn around
    model:SetPrimaryPartCFrame(angcf + (p0+(p1-p0)*p))
end)

This is an oversimplified example which I haven’t tested so it might not work, but it’s just as a simple explanation.

  1. Where does the script go?
  2. I don’t see any variable for the part. So how do I know what its moving?