Character Rotate to Cursor Location

Evening all. I’ve spent some time trying to get this working, to no avail.

I simply want the character to rotate towards the cursor location on screen. In a top down perspective.

I have it working like this.

https://forums.unrealengine.com/attachment.php?attachmentid=111629&d=1474932876

But this isn’t ideal as it is tracing for objects under the cursor, as opposed to using the actual screen location of the cursor.

As you can see in this video, with my mouse held still, the character snaps to different rotations when i move under an object and back out again.
[video]- YouTube

So. I’m trying to do something like this…

https://forums.unrealengine.com/attachment.php?attachmentid=111630&d=1474933129

In theory this would work a lot better. But I just can’t seen to get it working in any usable way.

I tried printing the return values of the nodes like this

https://forums.unrealengine.com/attachment.php?attachmentid=111631&d=1474933183

But the values from the hit result under cursor and the Get Mouse Position are completely different.

Any one have any ideas how to go about getting this working correctly?

Thanks in advance! Much appreciated!

there is a blueprint function called “convert mouse location to world space”. use this with a line trace to trace towards the world location till it hits something.

Here are links that may help :

a forum thread

another answer hub post

Unfortunately that doesn’t work correctly either. The character still snaps to a different angle if the cursor goes over an object.

AS can be seen here.

Using this set up


Thanks for the reply!