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"

Character movement toward mouse cursor

I'm trying to get the player character to move to wherever the cursor is located, but so far the only method I've found results in jerky movement and abrupt stops when the cursor passes over an object or a wall. I assume this is because the character is unable to move to that location, but completely preventing the character's movement is unnecessary because the player will just collide with any objects or walls that they cannot pass. So, is there any way to have the character just move directly toward wherever the mouse is located? I've tried to get the cursor's location and send the character to wherever that is, but I can't find a way to make it connect in the blueprint.

Product Version: Not Selected
Tags:
more ▼

asked Apr 16 '15 at 02:47 PM in Blueprint Scripting

avatar image

Frostycane
6 5 8 8

avatar image Samantha Sutton ♦♦ STAFF Apr 16 '15 at 03:48 PM

Hey Frostycane,

Which version of the Editor are you using? Also, would you be able to upload a screenshot of the blueprint that you've set up for this character movement? The more descriptive information we have, the better.

Looking forward to hearing from you!

avatar image Frostycane Apr 16 '15 at 04:30 PM

I'm using version 4.7.5

As for the blueprint, I had been using the top down sample as a reference. But the problem with that blueprint is, whenever the cursor is over an object or wall, the character abruptly stops moving. So I'm wondering how one would construct a blueprint that would prevent that from happening, or simply bypass the problem altogether by simply allowing the character to move directly to the cursor, rather than the location underneath the cursor.

It's less of a question about an existing blueprint and more a question about how I would go about constructing said blueprint. Or modifying the top down sample's blueprint so that it won't jerk or abruptly stop when the cursor's over objects or walls.

avatar image Samantha Sutton ♦♦ STAFF Apr 16 '15 at 06:56 PM

Hey Frostycane,

If you set the collision preset to 'invisiblewall' it makes the movement behavior a bit different. Is this more of what you're looking for?

Set Up: Click on the wall that's causing an issue, under 'Collision' there is a drop down for 'Collision Presets' and that's where you'll find 'InvisibleWall'.

Cheers!

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

2 answers: sort voted first

Hey Frostycane,

I haven't heard from you in quite a while. For recording and tracking purposes, I must close this thread at this time. If you happen to still have any unanswered questions regarding this specific topic, please do not hesitate to reply to this thread.

Cheers!

more ▼

answered Apr 20 '15 at 07:47 PM

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

So I don't know for certain how to do this, but you probably want to be moving the character no exactly toward the mouse cursor, but toward the last point that the cursor was on the nav mesh. I'd probably start by messing around with "get hit result" and using the "project point to navigation" to move around a marker or something that the pawn can move to.

more ▼

answered Apr 16 '15 at 06:50 PM

avatar image

Stuckbug
158 15 14 28

(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