How To Rotate Player Towards Spline in Both Directions?

Hello so currently I have a grinding system where my player can jump onto a spline and move along it but my problem is rotating the player along the spline in both directions so it looks believable

I dont move the player along the spline based on the distance along spline rather I do it based on the players velocity so it can go on the rail at a fast speed etc.

How could I go about rotating the player in both directions?

I have a link for the blueprint here if you’d like to take a look

I’d also be happy to elaborate any help would be appreciated thank you!

also if there is a better/cleaner way of achieving this I’d be happy to explore different methods.

What if you took the Forward Vector of the character’s velocity, compared that with the forward vector of the closest spline component, and if the dot product of the two is negative, reverse the character’s rotation?

Or maybe the Lookat between the closest spline component and the one it leads to next

How would I go about getting the Forward Vector of the characters velocity?

also when you say spline component did you mean spline point or the entire component itself?

thanks.

Well I mean the spline point if that’s where the rotation of the spline is set.
I guess forward vector comes from rotators.
Maybe this will work - top part is the character’s velocity normalized to a unit vector.
Bottom part is the forward vector from the spline point’s rotation.

255542-capture.png

Ok so I’m able to get the correct rotation both forwards and backwards on the spline when its facing the X axis using this.

But when its facing a different axis it makes the character turn away from the spline, how would I go about checking for that and rotating accordingly?

Thank you for the help so far though this is a massive step in what I wanted to achieve!

Maybe should use world space and not local space?

I was able to achieve it by using the same method above but using the right vector for the different axis instead of the forward.