Hi there.
We can make an animation object with its path as Sergey K suggested and then just play the animation and adjust speed. If we like challenge of doing that with code, we can spread out some waypoints all the way we want the train to go. I take some code from a snake game I made time ago. I hope it can help someone.
autocam off
sync on
`train
for i= 1 to 10
make object box i,2,2,4
offset limb i,0,0,0,2
position object i,0,0,-i*4.5
next i
hide object 1
`waypoints
for i= 1 to 5
make object sphere i+10,2
color object i+10,rgb(255,0,0)
next i
position object 11,-20,0,30
position object 12,30,0,50
position object 13,40,0,0
position object 14,20,0,-20
position object 15,-10,0,-20
position camera -30,60,-30
point camera 0,0,0
ob=11
do
point object 1,object position x(ob),object position y(ob),object position z(ob)
if object collision(1,ob)>0 then ob=ob+1
if ob=16 then ob=11
move object 1,0.03
for i= 2 to 10
point object i,object position x(i-1),0,object position z(i-1)
dx#=object position x(i-1)-object position x(i)
dz#=object position z(i-1)-object position z(i)
distancia#=sqrt((dx#*dx#)+(dz#*dz#))
if distancia#>5 then move object i,0.03
next i
sync
loop
Cheers.
I'm not a grumpy grandpa
