Get rotation change along the spline point

Hi guys,
I’m using easy on movement to get the actor animation along the spline. The location is correct but i want it change the rotation too, i have the rotation value of each point spline but don’t know how to make the actor rotation animation with that.

Normally, you’d:

We can see multiple execution wires but not what they’re plugged into. Could this be the source of the problem? The rotation is also behind a Branch - are we confident the execution chain can reach the rotation node ok?


On a side note - is the spline a component of the actor that is being moved here?

1 Like

Yes i’ve create a sp spline and create a spline point to a specific location!

Thank for the reply!
I just simulation the pluggin just doing these bp code. But i can’t get the rotation i want

So you can see there is 2 ship. Ship 1 is the rotation i want at each point. Ship 2 is the running animation. The location is right but not the rotation at each spline point

The script above seems to be ok. My guess is that the culprit is elsewhere. Could you show the spline?

Either move the spline point generation to the Construction Script of the actor or run the game as is but with:

image


Is it possible that some points of the spline already exist and we forgot to clear it before adding new ones?

1 Like

I guess the problem is my mesh pivot. When i change the mesh pivot it seem to be ok.
But as you can see i have the array rotation for each point spline and i think the function Get Rotation at Distance Along Spline can’t get the rotation at the point spline and rotate the mesh to exactly rotation in the array.
Sorry for the long explaination and correct me if i am wrong cause i just new to ue.
Really appreciate if you help me with this!

This has little to do with points per se. We’re not using points directly here - note how you’re sampling the spline data in-between its points.

I guess the problem is my mesh pivot. When i change the mesh pivot it seem to be ok.

If the pivot is the culprit, perhaps this needs fixing instead, as the method you’ve demonstrated above appears to be correct.

1 Like
This has little to do with points per se. We’re not using points directly here - note how you’re sampling the spline data in-between its points.

Yes this is what i am trying to tell you. I don’t know how to get the spline data (maybe distance value between each point) to make to actor rotate to the value in rotation array.

You’re doing it already… You said it yourself - the changing pivot fixes it. So what does the Timeline’s track outputs - we’d expect 0-1 values here?


And if you really need rotation at spline point:

image

But this seems pointless here since you already have the array.

1 Like


This is a quick example i made. As you can see the camera did rotate but can’t get to the rotated position at each spline point. The pivot are correct but still can’t get it.

Is this what you’re trying to achieve?

The transforms match when arriving at spline point. If this is not the behaviour you’re experiencing on your end, please answer the questions I asked above so we can investigate.

1 Like
Is this what you’re trying to achieve?

Yes it’s what i want to do. But can you show me the code when you add the spline point. And how you set the rotation at each spline point.
Really appreciate your help!!!

My guess is that you’re adding linear spline points. Rather than curves, you’re getting straight lines. Your rotations are fine but we can’t see it as there is no time for us to register what’s happening at spline point.

Please do visualise your spline as suggested above - so you can see how it looks like in game.

  • Your spline probably looks like this:

  • While you may want this instead:

Add this to the generation:

image

Alternatively, you can manually calculate tangents if the auto method is not good enough:

1 Like
While you may want this instead:

Yes i want that curves line but it seem the spline point type is not working when i add it to the generation.
Maybe the Add Point is the solution for me cause it have the point rotation at each point. But i have the problem with these input and i am trying to make it work.

Can you show the script?

1 Like

This is the script and the code in red circle is the issue.

As you can see in the clip the ship can’t rotate with the wide rotation at some last point spline.
Untitled Project.wmv (20.5 MB)

I do not understand why you refuse to visualise the spline and just check what is going on… Also, count the spline points, perhaps you create too many. You never answered any of my questions so I honestly can’t help.

edit:

How are you actually creating the points / rotations for the array? Are you reading the transforms of that pre-positioned mesh? If so, this might be reason for the inconsistent behaviour - you’re expecting a specific spline shape but it may not work the way you think.

You must see the shape of the spline, this should answer some questions.

1 Like

I really thank you if you tell me how to show the spline with the pivot when playing. I had research for it but don’t have the answer.

So what does the Timeline’s track outputs - we’d expect 0-1 values here?

Yes the timeline’s track return 0-1 values.

This is the shape of my splines. But don’t have the zyx value.

So if you visualise the spline in-game with show splines, add debug coords:

…and add the meshes back, what do you get? Do things line up as expected?


Could you answer my previous question:

How are you actually creating the points / rotations for the array? Are you reading the transforms of those pre-positioned meshes?

Or is the data punched in manually into the array?

What I’m thinking is that even though you’re adding specific rotations, when the spline gets updated, its shape will change as the tangents will adapt to the previous points, distorting it slightly from what you intended.


The point is rotated like so:

image

If you want to ship (green) to rotate like this, you cannot rely on spline data directly.

1 Like

I want to make the animation for my mesh so yes i read the transforms of pre-positioned meshs.

What I’m thinking is that even though you’re adding specific rotations, when the spline gets updated, its shape will change as the tangents will adapt to the previous points, distorting it slightly from what you intended.

So is there anyways to change that :frowning:

1 Like