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 will help a lot keeping Curvy relevant in the eyes of the Asset Store algorithm.
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 will help a lot keeping Curvy relevant in the eyes of the Asset Store algorithm.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  locking vertical orientation/alignment BenStorch 9 2,381 05-16-2021, 08:28 AM
Last Post: _Aka_
  How to rotate orientation? ahkow 3 1,121 12-09-2020, 04:49 PM
Last Post: _Aka_
  Player to Train DeadCcell 3 1,173 12-08-2020, 08:07 AM
Last Post: _Aka_
  How to ping-pong a train? jamesunity 5 2,605 07-13-2020, 11:56 AM
Last Post: _Aka_

Forum Jump: