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"

How to slide actors against obstacles when changing their location?

I am currently moving a character using the 'get actor right vector + get actor location' inputting into a 'set actor location' node. This is moving the character correctly but it goes through walls. Enabling "sweep" on the node stops the character from going into the wall, but also from moving at all when touching something. How do I make it so I can move an actor in a specific direction but after hitting a wall, it slides against it like how a player controlled character moves.

Product Version: UE 4.14
more ▼

asked Mar 24 '17 at 06:58 PM in Blueprint Scripting

avatar image

Rez Nov
25 9 10 12

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

2 answers: sort voted first

Setting the location is basically warping an object according to the physics simulation. Instead you just want to set the player velocity (SetActorVelocity / SetMovementInput node). This will allow the physics scene to move your character and stop them if a collision occurs.

See here: https://docs.unrealengine.com/latest/INT/Gameplay/HowTo/CharacterMovement/Blueprints/Setup_2/index.html

more ▼

answered Mar 24 '17 at 07:03 PM

avatar image

1.6k 34 14 48

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

May be a bit late, but your could apply each of the motion vector elements (e.g. X, Y) one after another. Break the vector into components, generate new vectors containing ony zeroes and one component, and use the generated vectors as input for consecutive location updates. This way not all of them will be inhibited, resulting in a sliding movement.

more ▼

answered Jun 25 '17 at 01:06 PM

avatar image


avatar image ansonkit Apr 27 '18 at 05:56 AM

Hi there, sorry for my noob. but can you please show a screenshot of the BP of what you mentioned up there ? thank you very much

(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