Topdown : How can i find the distance between pawn and mouse cursor

hello i hope you guys can help me out iam pretty new to this blueprint gameplay coding i use to make assets now going to try to make a little game for myself :smiley: try to be my own game designer.

how can i find the distance from my pawn to my cursor. iam using top down template what iam trying to do is to make it walk if u clicking close to the character or els the character runs i hope you guys can help me out

sry if this is a noob quistions

thanks in advance
cheers

Hi,
From my point of opinion.

Now you have got your world location and your clicked location, you can use this node(I‘m not sure if it’s this word,my nature language not English )

244652-get-path-length.png

Link the two position,and it can calculate the length.

Hi,

Follow my graph,

This will give you what you ask for.

regards,

get path length has nothing to do with the question asked. It is used for navigation.

hi thanks for answar :smiley:
i found out the way to get the length so i can use it to control the speed. i will try to use path length and see what i can do with it thanks agian really appreciated thanks

the video here :
[UE4 - Move Test - YouTube][2]

this is how i got the length from my character and mouse cursor seem to be working iam absolute new to this blueprint code so if u have a better way todo this please be kind to share :smiley:
thanks agian for the responds

wow that make it look so complex :smiley: i will try that i see what is different from my version thanks :smiley:

yes just change the right answar thanks :smiley:

It’s quite simple. It projects the world position of your actor on to the screen and calculates the distance from your mouse cursor and the projected position in screen space.
Regards,