Download

Wrong rotation Procedural Content with Blueprints

[IMG2=JSON]{“data-align”:“none”,“data-size”:“full”,“src”:“https://forums.unrealengine.com/core/image/gif;base64,R0lGODlhAQABAPABAP///wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw==”}[/IMG2]​​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

[IMG2=JSON]{“data-align”:“none”,“data-size”:“full”,“width”:“85”,“src”:“https://forums.unrealengine.com/core/image/gif;base64,R0lGODlhAQABAPABAP///wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw==”}[/IMG2]​​

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

[IMG2=JSON]{“data-align”:“none”,“data-size”:“full”,“src”:“https://forums.unrealengine.com/core/image/gif;base64,R0lGODlhAQABAPABAP///wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw==”}[/IMG2]​

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)

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