View Single Post
# 8 14-08-2010 , 05:21 AM
Xander-0's Avatar
Registered User
Join Date: Feb 2005
Location: This Place
Posts: 220
Here's a script that will allow you to control an object's position on a path, based on some other object's position. This can be adapted to run objects at different speeds as well. Note - the objects will 'loop' around the ends of the curve (starting back at 0) once they reach the end of the curve (the curve is assumed to be in the range of 0->1)
I originally developed this to control tank treads. You should be able to dump it into the uValue parameter as an expression. I'm afraid you may be on your own for creating duplicate cars, though (never set that part up, I'm afraid).

//general form of equation:
When ((primary tread's path uValue) + (uValue moved from primary tread) less than 1):
(primary tread's uValue) + (uValue moved from primary tread);
Example:
if ((tread0Path.uValue) + (0) < 1) {
tread1Path.uValue = (tread0Path.uValue) + (0);

else:
subtract one from above
Example:
} else {
tread1Path.uValue = -1 + (tread0Path.uValue) + (0);
}


Book Wise

https://X4nd5r.deviantart.com