How can I fix rotation on my fence blueprint?

How can I get the railings to face the posts.

Here is how it currently looks:


Here is the blueprint so far. The Sequence just leads to the same stuff as you see in the screenshot except the mesh is swapped for a railing instead of a post.


Can anyone point me into the right direction?

It appears your rotation is off. I know that is obvious.

Why are you setting Rotation after spawning and not during spawn?

Try that, see it make a difference.


What you could do, turn the fence into a BP, add an arrow to one end or a socket.

When spawning, spawn at the point.

There is an example of endless runner on UE4 doco that show how to do this attaching.


I don’t think the construction script allows for spawning of actors from a class. I tried moving that to a function like in the tutorial and referencing the function within the construction script but that didn’t work either. It works in the event graph but then fence isn’t visible until you start playing which makes it difficult to see where you are placing your fence. I did figure out a solution to the rotation issue but a new problem popped up.

This is what the construction script looks like so far:FenceSoFar.JPG

The issue I am now having is that sometimes the fence railing can poke through the post like this:aca5dbaf02277c9c968f9bb49e46d2f69d21cc6a.jpeg

This happens because of the way I calculate where the fence should spawn. The fence length is 300 units so I multiply that by the number of fence segments it should spawn and then use that as the distance along the spline to figure out the world location. Because the spline can curl up on it self the distance along the spline will still be n*300 but the distance between one post and the next will be much smaller allowing the railing to poke through the post. This could be resolved if I was spawning a fence blueprint like you suggested the next spawn would simply be at the end of the previous spawn but the construction script doesnt allow for spawning actors of a class.

Here is the distance calculation:9dd5b1dd958dccacf762b0488c3dfef29cc43b09.jpeg

Anyone have any suggestion on how to fix this?