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.
asked Mar 24 '17 at 06:58 PM in Blueprint Scripting
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.
answered Mar 24 '17 at 07:03 PM
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.
answered Jun 25 '17 at 01:06 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here