Wrong rotation Procedural Content with Blueprints

https://forums.unrealengine.com/core/image/gif;base64
​​Hi,

I’m following the official unreal course (Procedural Content with Blueprints) but the mesh created does not follow the spline, the rotation is wrong.

This is my construction script :

I’m calculating the distance between two points in the spline


https://forums.unrealengine.com/core/image/gif;base64
​​

then I divide the vector length of these 2 points by the size of my mesh (Wall_400x400), floor function, and another loop


https://forums.unrealengine.com/core/image/gif;base64

Finally I get the Location and the Tangent along the spline and add an instance of a static mesh.

The location gives me the vector and I get the rotation from the Tangent vector (RotationFromXVector)

7926d95cedf52058d6d9e4544965e0d4f7077105.png

My problem is that the static mesh is not correctly following the Spline, it has like a 90 degrees rotations which I don’t know why.

Thank you