I am trying to create a simple project where a train follows a spline, easy. Everything is working, but at some points, the train is rotating up and down really fast for no obvious reason. I checked spline points, there are no sharp curves or something like that.
I also dynamically spawn railroad mesh along the same spline and there are no weird rotations or curves.
Also, I have a bridge in front of this image, and rails (spline) is curving upwards (elevating) and the train does not glitch there at all. Also, there is a long straight rail section, nothing happens there.
Btw, since I am new to Unreal, here is how I configured my Train actor, in case I misconfigured something:
Train Static mesh is the mesh you see, Speed Lever static mesh is just a mesh inside the train that you can use to start/stop the train, and the Trigger box is just that, it does not collide with anything.
Another thing I noticed, and this is really weird for me.
I tried printing train’s actor rotation every frame, and pitch rotation ranges from 0.1 to 0.3, but at the moment when the train “jumps”, it goes to around 2.5: