Hi,
Thanks for the provided scene. Well, this effect is written to be used with "side splines" and it "shifts" the position of these cars automatically (by using the collision radius of the item). In case you would like to use a "centerline", it should be modified a bit (the collision radius should be removed). It may look like the following:
## translate X Y along item's local normal ##
real angle = fpItem.rotation.z;
fpItem.rotation.z =fpItem.rotation.z + if(randomInt(0,randomiseParkDirection)==1,degtorad(180),0);
real randomOffsetX = randomInt(xoffsetStart,xoffsetEnd);
real randomOffsetY = randomInt(YoffsetStart,YoffsetEnd);
vector position = [cos(angle)*randomoffsetX, sin(angle)*randomoffsetX,0];
position = position + [cos(angle-degtorad(90))*(randomOffsetY), sin(angle-degtorad(90))*(randomOffsetY),0];
fpItem.position = if(switchSides==0,fpItem.position+position, fpItem.position-position);
int spaceProbability = randomInt(1,100);
fpItem.visible = if(emptySpaces >= spaceProbability,0,1);
##project onto surface in new position
fpItem.position.z = fpSurfaceHitZ(fpItem.position);
## Align to surface at new position.
vector v = unit(fpSurfaceHitNormal(fpItem.position));
vector v3 = unit(crossprod(fpItem.yrotaxis,v));
vector v2 = crossprod(v,v3);
fpItem.xrotaxis = v3;
fpItem.yrotaxis = v2;
fpItem.zrotaxis = v;
I hope that clears it up and in case of any further question(s) or doubt(s), please don't hesitate to contact us. Have a great day.
Best regards,