- Home /
Question by
Wenon · Dec 05, 2018 at 07:13 PM ·
pathcurvecurved path
Train spawn on curved path
Hello, my curved path consists of hundreds of points in one array. Spawn one car is no problem but if I want to spawn train consisting of 10 wagons, how can I do this. How to find position for 10 wagons if they have to have fixed distance and they should never separate. Train without rigidbody.
Comment
Answer by SunnyChow · Dec 06, 2018 at 08:07 AM
there is a brute way. you set a number as distance, make a loop start from first car, reduce distance with the next point until it's <0
Do you mean spawn second car on the locomotive' position and then move car back until distance between couplers will be <=0? And the same think with third car and second?