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"

Move a character with the mouse

I have created a blank blueprint project and I have a character that moves around the screen in third person. I am trying to find a way to move the character by using the left mouse button, like what happens with the top down template. How would I do this using blueprints? I cannot find a way of doing it. I believe it has something to do with the input settings within the project settings but I cannot figure it out.

Product Version: UE 4.16
Tags:
more ▼

asked Oct 17 '17 at 08:10 PM in Blueprint Scripting

avatar image

MartyBro
11 4 5 6

(comments are locked)
10|2000 characters needed characters left

1 answer: sort voted first

I believe it has something to do with the input settings within the project settings but I cannot figure it out.

Unlikely. I am assuming you want to move to click location. You will need to project the mouse location to world location and then update the character location on tick.

more ▼

answered Oct 17 '17 at 08:38 PM

avatar image

Everynone
12.6k 72 24 53

avatar image MartyBro Oct 17 '17 at 09:05 PM

How would I manage this exactly?

avatar image Everynone Oct 17 '17 at 09:52 PM

The topic reads Move a character with the mouse but most likely you want to move to a clicked location instead (like in an RTS). Or you want the character to keep moving while you hold the mouse (like in a top down action RPG). Could you confirm?

One way or another, it's going to be similar, here's one method (of many):

https://answers.unrealengine.com/questions/712174/how-to-use-mouse-aim-on-2d-top-down-view.html

Use the intersection as target location. Interpolate between your current location and the target. Rotation is included.

avatar image MartyBro Oct 18 '17 at 09:54 AM

I am trying to make the character move to a clicked location.

avatar image Everynone Oct 18 '17 at 11:02 AM

Then you have the most basic solution up there, in the link. If you want something more complicated, trace against the ground mesh from camera position.

(comments are locked)
10|2000 characters needed characters left
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