# Object rotating hen i start play

hello ,
I’m trying to make a train fllow a spline , it does follow it but the moment I hit on ‘Play’ , the train immediatly rotates and follows the path in wrong direction…Those are my blueprint and pictures of the problem .
243580-

untitled.png

What is “timeline output” outputting as the float value?

A value between 0 to 1 .starts with 0 at beginning and 1 at end point of the spline

Is your spline facing the right way? It has a directionality to it, so wherever you “place it” that is the start point and as you drag out you create the “end point” Have you tried just breaking the “rot” and adding 180 to the “z” and see if that at least gets it going in the right direction?

The spline faces straight from the train as I want it to, it follows the path well but the issue is the moment I run the program , before the train starts moving it spins 90 degrees to the side and moves like this , even though before the run it’s perfectly positioned … as in the first picture.
What does breaking the ‘rot’ means?

Break “Rotation”, you can search for “break rot” in the event graph that’s what comes up. Then right click on the “rotation” pin and it will break it into 3 floats (x,y,z axis). But that looks like an issue with using the “spline rotation” to set the train rotation. Something is off there so your spline’s world rotation is 90 degrees off from the train’s rotation. Try not setting the rotation to spline rotation for now and see if that fixes the issue.

where did you see that ? I don’t see it’s like this … it shows 0 on all x y z axis

AZTECCO is right, if you look at the first image you have there of the train, the “red” axis which is the “x” axis is actually perpendicular to the spline, so when you set the rotation of the train to spline rotation it rotates it 90 degrees so the “x” axis of the train is parallel with the spline. This is an issue with however you modeled the train in the 3D software. Your axis is not the same direction. You can flip it in the view port by adding or subtracting 90 degrees from “x” or you can fix it in the 3D software.

Initially yes, but you would need to do that on the Z axis. But as pointed out above easier to just change the direction of your axis for the entire mesh in the viewport or 3D software. Again if you do this in the viewport you want to rotate the Z axis 90 so the forward X direction isn’t perpendicular to the spline track. Look at your first image, the red arrows is perpendicular to the white track of the spline. That’s why it rotates 90 so the red arrows points down the spline which just so happens to cause your train to be sideways

I tried this fix but it still doesn’t work properly … is this what you ment ?
Btw - tons of thanks to you both for your help

Agree… If you adjust your mesh you are more tidy/readable/intuitive , which is a good habit , plus you optimize your graph… No break +add+make rotator… Just pass rotation like the first picture! I will absolutely fix the mesh!

How-to here…

fixed ! thank you guys so much ! you’re life savers

In fact I noticed the x axis of the mesh is 90 degrees! While the y axis is in line!

Anytime! Then if @Nebula Games Inc agrees you may accept my answer (I converted my first comment)

Haha you don’t need my permission. Pretty sure you’re the one who caught the axis issue anyway… I’m just happy we figured it out