02-18-2021, 04:08 PM
Hi, I've decided to change how I move objects on a spline by using two points instead of one so I can increase the precision of the edges of the objects(so they align better with the objects in front/behind of them). I thought of mimicking your train example, but slightly different.
I have the object setup as a prefab with all meshes and stuff as children. My idea is to also create two fixed points, one in front and rear, also as children to the prefab. Then align them to the spline and then place the whole prefab in the center of those two points.
Now the problem. Precision is very important here so I need that once they align to the spline, the world distance that the two points have to each other should be exactly the same as they had to each other in the prefab, before aligning. Placing the first point is no problem, but I have no idea how to get the point on a spline that is X world units, in a straight line, from the first point.
I use Playmaker so I don't need any code, just how to calculate this.
Or, if you have a better way to do this, I would like that instead.
I have the object setup as a prefab with all meshes and stuff as children. My idea is to also create two fixed points, one in front and rear, also as children to the prefab. Then align them to the spline and then place the whole prefab in the center of those two points.
Now the problem. Precision is very important here so I need that once they align to the spline, the world distance that the two points have to each other should be exactly the same as they had to each other in the prefab, before aligning. Placing the first point is no problem, but I have no idea how to get the point on a spline that is X world units, in a straight line, from the first point.
I use Playmaker so I don't need any code, just how to calculate this.
Or, if you have a better way to do this, I would like that instead.