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. 

Move to click loaction stops before reaching the edge

alt text

So currently I have the standard top down controller and when you click an area, like a pillar or off the ground or anywhere they player can path to it just stops moving or doesn't attempt to get there. I would like it to run to the furthest point it can then stop, even better I would like it to still run to the mouse if its clicked in a unreachable area, and just face the mouse if it cant move there. Ive attached a picture of my current BPs. its nothing complicated as I know very little about Blueprints As always any help is appreciated, Thanks!

Product Version: UE 4.9
Tags:
more ▼

asked Sep 24 '15 at 05:30 PM in Blueprint Scripting

avatar image

CodyScrib
53 9 16 21

avatar image Sean L ♦♦ STAFF Sep 24 '15 at 06:16 PM

Hello CodyScrib,

With the TopDownTemplate that is available with the engine, when you click on a location that the character cannot reach, the character will move to the closest point. Could you perhaps provide more information or a video of exactly what type of behavior you are experiencing, and what you would like to happen instead?

Thanks,

Sean Flint

avatar image CodyScrib Sep 24 '15 at 07:15 PM

alt text I think this Gif explains it. When I click or click and drag to an area that cant be traversed the character stops moving entirely instead of going to the furthest point. I hope this helps explain things

untitled-1.gif (4.5 MB)
(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

Hello CodyScrib,

Now I understand what it is that you are trying to achieve. My recommendation for you is to take a look at the TopDownTemplate. Create a project using this template and look at the TopDownController. If you notice, there is a Move to Hit Location function established with an input for the hit result. Then in the event graph, there is a simple function call that tells Move to Hit Location to execute when the mouse button is clicked, and provides the function with the hit location of the mouse click. This should help you figure out exactly how to set up the movement so that your character will continue to move even if you click an area that it cannot reach. Try to mirror these controls over to your current project, and you should be able to get your desired result.

Have a great day,

Sean Flint

more ▼

answered Sep 24 '15 at 07:25 PM

avatar image

Sean L ♦♦ STAFF
43.6k 485 152 442

avatar image CodyScrib Sep 24 '15 at 08:05 PM

Thanks Sean, I build all my BPs from the top down preset, they are pretty similar I cut out the touch stuff and I added a line that tells it not to move if the click is to far away. Forgive me if im missing something, maybe a check mark ive missed or something. The linked pictures are my BPs compared to the Presets!

alt text

avatar image Sean L ♦♦ STAFF Sep 24 '15 at 08:32 PM

Hello CodyScrib,

Since you've added the line that tells it not to move if the click is too far away, why don't you try removing that part of the logic and seeing if you can get the desired result without that? If so, then that will tell you that there is some issue with the logic that you've added, and if not, then we can keep working on the issue.

Look forward to hearing back from you. Have a great day,

Sean Flint

avatar image CodyScrib Sep 25 '15 at 12:34 AM

Ok I removed that portion and the results are the same. It still stops when the click location. I assume it must be something I missed in the "Details" panel somewhere

avatar image Sean L ♦♦ STAFF Sep 25 '15 at 12:49 PM

Hello CodyScrib,

I see one more thing in your blueprint that could potentially be causing an issue. Try removing the Break Hit Result node before you call your MoveToLocation function. Instead of having this, just plug the hit result directly into the Hit section of the MoveToLocation node. It seems like you're telling the player that if the location that it is trying to reach is equal to 0,0,0, then don't move. This may be why the player stops moving when a spot that it cannot reach is clicked. I look forward to hearing your results.

Have a great day,

Sean Flint

avatar image CodyScrib Sep 29 '15 at 05:35 PM

So I removed that part and the problem still exists. Not to sure what the next step would be. The idea behind that was that if i clicked off map originally the player would return to the center, so if I added that part when i click off the map he would just stop moving.

avatar image Sean L ♦♦ STAFF Sep 29 '15 at 05:41 PM

Hello CodyScrib,

The next step would be for you to zip up your project and upload it to Dropbox or Google Drive and provide a link so that I can take a look and see exactly what is causing your issue. If you have concerns about privacy, you can send the link to me in a PM. I look forward to having a look at it.

Have a great day,

Sean Flint

avatar image CodyScrib Sep 29 '15 at 05:44 PM

Alright ill do that for you right now

avatar image CodyScrib Sep 29 '15 at 05:51 PM
avatar image Sean L ♦♦ STAFF Sep 29 '15 at 06:20 PM

Hello CodyScrib,

I've figured out that the issue with your movement is not the blueprint. In fact, it was the way that you have the navmesh generating on your level. The way you've generated your terrain seems to have left extraneous geometry that is causing a navmesh to generate in incorrect locations. If you press the "P" key in editor, you can see the holes in your navmesh that are preventing movement. To verify, if you place a flat plane in your level and add a navmesh, you'll see that your character will move as you want it to. So, simply put, the issue is that your navmesh is not generating properly. You'll want to take a look at how your terrain is being generated and attempt to polish it a bit so that the navmesh generates properly.

Have a great day,

Sean Flint

(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