x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Office Holiday

Epic Games' offices will be on holiday from June 22nd to July 7th. During this period support will be limited. Our offices will reopen on Monday, July 8th. 

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

alt textalt text

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 :D 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

Product Version: UE 4.19
Tags:
ue4.jpg (213.3 kB)
ue4-2.jpg (492.6 kB)
more ▼

asked Jun 17 '18 at 11:54 PM in Blueprint Scripting

avatar image

EliteTech
3 1 4

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

3 answers: sort voted first

alt text

the video here : https://www.youtube.com/watch?v=v0r_1N8tBko

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 :D thanks agian for the responds

ue4-4.jpg (917.2 kB)
more ▼

answered Jun 18 '18 at 03:24 PM

avatar image

EliteTech
3 1 4

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

Hi,

Follow my graph,

alt text

This will give you what you ask for.

regards,

capture.png (201.0 kB)
more ▼

answered Jun 18 '18 at 03:28 PM

avatar image

navid100
1k 29 14 46

avatar image EliteTech Jun 18 '18 at 03:30 PM

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

avatar image navid100 Jun 18 '18 at 03:36 PM

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,

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

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 )

alt text

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

more ▼

answered Jun 18 '18 at 04:34 AM

avatar image

不贰心
1 1

avatar image EliteTech Jun 18 '18 at 03:21 PM

hi thanks for answar :D 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

avatar image navid100 Jun 18 '18 at 03:31 PM

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

avatar image EliteTech Jun 18 '18 at 03:32 PM

yes just change the right answar thanks :D

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question