How to make an Arrow attached to the play which is looking to the Mouse Curser.

Hope someone can help with that.
What i already tyied:


Hmm you are projecting character to screen and trying to compute direction to mouse position… The idea ain’t bad but a 2D screen space direction/rotation won’t translate that easily to 3D space.

Instead you should deproject mouse cursor to world, then you can compute a proper 3D rotation from two points in space.

When deprojecting you need to specify how “far” out you want to go.
There are nodes such as GetHitResultUnderCursor that will trace out until they hit an object. It can work, but for a top-down game this may not be ideal as it could give inconsistent results when hitting non-uniform terrain or decorations above/below the player. I suggest using DeprojectWorldToScreen which gives you basically camera position and a direction vector pointing out from desired screen location (mouse pos), and use those to calculate intersection with a plane defined by the player character. No collision, just math.

1 Like