Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Orient Spline to Object
#1
Hi,

I am trying to get a physics based train to travel along a spline made up of separate splines on prefabs. Instead of messing with the physics on the train, I am leaving the physics alone and moving the world under the train. I can get the world to move each segment of track(each a separate spline), but I can't get the world to rotate to line the rails(spline) with the train.
What I have so far,
Each frame
- The train moves forward via physics.
- After the train has finished moving I move each segment(these are children of a world object) the same movement the train has made that frame.
- I then reset the train back to the origin.

The train follows the splines perfectly, but I now need the parent world object to rotate to align the spline (nearest spline point on the nearest segment) to the train which is always pointing forward in the world.

Any ideas would be really helpful

Thanks
Dan
Reply


Messages In This Thread
Orient Spline to Object - by DanMarionette - 06-10-2019, 05:23 PM
RE: Orient Spline to Object - by _Aka_ - 06-11-2019, 05:56 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Spline Issue Leading to Unity Freeze Pankaj09 1 187 08-24-2026, 11:28 PM
Last Post: _Aka_
  Spline Spots from 2 samples. BitBlit 8 1,073 06-30-2026, 11:49 AM
Last Post: _Aka_
  Best way to duplicate a spline with an offset Kapistijn 8 2,445 04-12-2026, 03:18 PM
Last Post: _Aka_
Smile Constant speed along a spline? tfishell 1 997 11-13-2025, 11:32 AM
Last Post: _Aka_

Forum Jump: