Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Train car orientation on slopes
#1
Apologies if this question has been asked. I couldn't find a similar question from a search. And further apologies for asking a question about the train car manager - I know it's just demo code, but I'm still trying to use it as a starting point.

I'm almost happy with my train, but what I'm seeing now is that when the train goes up and down hills, the cars don't orient to the slope. has anyone else encountered this? And/or does anyone have any idea how to support rotating the cars so they look more natural? It looks pretty odd, here's a picture:

[Image: 2021-03-21-23-36-07-Tiled-Terrain-Sample...0-2062.png]

thanks for any help!
Reply
#2
Hi
You will have to modify the code such as the orientation and position of the wagon of a car ("Body" game object in the example scene) has both its position and orientation solely computed based on the the position of FrontAxis and BackAxis game objects.
A simple scheme of how to do it
   
Please consider leaving a review for Curvy, this helps immensely. Thank you.
Available for freelance work—feel free to reach out.
Reply
#3
I figured this out. I just needed to adjust the height values of each of the control points on the underlying spline associated with the CG Path. It's working great now!
Reply
#4
Glad to read that
Please consider leaving a review for Curvy, this helps immensely. Thank you.
Available for freelance work—feel free to reach out.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Train-Wagon Wheels stathias 3 16 08-30-2024, 12:46 PM
Last Post: stathias
Wink Train carriage with 2 bogies following a path arcadeperfect 9 28 08-25-2023, 02:56 PM
Last Post: arcadeperfect
  Shapes points orientation itsGama 3 11 01-18-2023, 02:51 PM
Last Post: _Aka_
  2d - orientation looping_co 1 7 09-01-2022, 04:17 PM
Last Post: _Aka_

Forum Jump: