Is there a way to make a sprite face the direction in which it is traveling?
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:
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
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?
asked Nov 04 '16 at 02:45 PM in Blueprint Scripting
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
answered Nov 04 '16 at 03:05 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here