You can write your topic however you want, but you need to answer these questions:
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.
What is the issue? I have no clue how to make it
What solutions have you tried so far? Bunch of youtube videos.
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.
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.
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.
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
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!
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.