Help creating a moving train-like map

Hello everyone! I’ve been trying to get an effect like Vibe Train’s movement.
Example: The train moving while players are fine and not jittery, i know how this works, but i don’t really know how to recreate it.

I’m trying to make this effect for a map i’m making in a new game i am making.

It would be much appreciated if you could help!

Edit:
Hey I did it with the help of HugeCoolboy2007! Thank you so much! I’ll be sure to credit you when the map get added!

god i sound like an idiot.

1 Like

I am not a scripter, but couldn’t you have the scenery outside the train, move, not the train?

I know how that works, train doesn’t move, but the outside does. I’ve never found out how to achieve that.

Possibly CFrame, or you could use a surface UI, and use tweenservice. I would recommend taking my advice with a grain of salt, since I am not a scripter.

2 Likes

You don’t understand, none of this is surfacegui, decals, or any other image class, it’s all building.

I am pretty sure you would use CFrame

I only said surface UI, if you dont know how to use cframe, since tween service is really easy.

I know how to use CFrame, i just need to find out how to do endless tunnel effect.

-- just an example
local model = workspace.Model -- the outside
local defaultCFrame = model:GetPrimaryPartCFrame() -- the default cframe (where it should reset at)

local function loop()
	if model:GetPrimaryPartCFrame() == defaultCFrame - Vector3.new(100, 0, 0) then -- check if it went back a certain distance
		model:SetPrimaryPartCFrame(defaultCFrame) -- reset the position
	end

	model:SetPrimaryPartCFrame(model:GetPrimaryPartCFrame() - Vector3.new(10, 0, 0)) -- make it go backwards
	wait(0.1) -- so it doesn't crash studio
	loop() -- do it all again
end

loop() -- call the function

-- this script is just for a basic visualization of what it should look like, this may not work in real time
2 Likes

I will try it, thank you so much.

1 Like

image
So, that happened.

I’m thinking the outside was actually models being placed at a certain disance, then using CFrame to be pushed backwards, then destroyed after a certain amount of time.

Yea, I few errors in my script that I corrected