Is there a way to make a sprite face the direction in which it is traveling?

Hey!

First of all I’m wondering how the rotation is updating if you are using event beginplay once. I assume that the actor gets spawned when it’s time to rotate.

The issue is with the getmouseposition, because it uses screen space instead of world space. You can try to use ConvertScreenPositionToWorldPosition node after GetMousePosition, sometimes it acts a bit weird and you need to do additional math to find the correct position.

Try that and comment what happens

Cheers!

Ok, so I have some code that kinda works, but not how I originally intended…
In my game I have a grappling hook that has a sprite for the hook, and I want it so that whenever you use the grappling hook you are able to see that the sprite follows the direction that the hook is following.
Here is the code that is related to what I have so far:

113783-unrealforum.png

That is the original code, also here are the other pieces of code that are connected to the original code:

The return value on the make vector connects to the target spot on Find Look At Rotation

113785-unrealforum3.png

And Then 1 in Sequence is executing the SetRelativeRotation function.

Part of the problem that I run into is the fact that sometimes the sprite keeps rotating around and around, but sometimes it works somewhat as intended.
I have a feeling that I might be using the wrong function or that the whole setup is wrong. Any ideas?

So this is what I have now, (I also copied and pasted get player controller and get mouse position, added the node you suggested and connected the appropriate connections so that there were no compile errors) although now it doesn’t even work at all. Thoughts on why this is happening?

Finally! I figured out my problem MOSTLY, better than nothing. The thing that was messing me up was the fact that when I attached the return value for FindLookAtRotation to SetRelativeRotation, it was returning 3 values (roll(x), pitch(y), yaw(z)) where Yaw was the thing that would mess up the rotation for some reason. So what I did was I right clicked on both of those connected nodes and clicked Split Structure Pin. After I did that I just messed around with different combinations of connections and it would seem that using the x and y pins works the way that I want it to. I’m also executing SetRelativeRotation by using an event tick node (if you want to use event tick more that once, just use a sequence node). This isn’t exactly what I need, but I’ll post again if I find what I need.

Actually now that I think about it, I could even break the links between the two X (roll) nodes between Find Look at Rotation and SetRelativeRotation.