Download

How to prevent player from going through walls?

Hi.

I am trying to figure out how to stop my character from moving through walls.
The Root capsule component of it is very small.

Basically the size of the hips.
When the head collides with a wall i do not want the character to intersect the wall.
Of a limb for that matter.

Right now the only thing actually blocking the player from going completely through the wall is the root capsule component.
The problem is i cannot rely on this component because it is vertical but my player horizontal.

Enabling Root Motion rotation causes the player to not being able to move anymore, otherwise i would have used that.
Any other solutions to this issue would be much appreciated.

intersection.jpg

Hello,
only an idea to help solve your issue : maybe a box component added in bp-wall or in character which fit the mesh and is set to block all / ignore all when needed (i used that to block bug event in timeline doors and it worked fine). maybe adding a location/orientation comparison to check if overlaping is ever done.

I tried adding a box around the mesh and set that and the walls to block all. It still intersects. Almost like the walls ignore anything but the root capsule component

Strange as I would expect the physics rig to keep the player model from clipping the wall.

To be honest I’ve not got that far yet and could be wrong but seems to me that the physics behavior may need to be switched on and or changed from using the old school bounding box.

That’s a lot of clipping going on though and the player should fit as much inside the bounding “capsule” as possible and vertical collision about 4-5 units from the wall. Skin tight has and probably will never work 100% ever.

ok let me ask this.
How can you rotate the root capsule of the character?
Thats my main issue. If i can just rotate it, then i wont have this issue.
But rotation is not available.

I just made the capsule bigger. Its not what i want but will suffice for now.

What i do find odd is that if i used the box to block all around the character, other objects like lamps n stuff will not clip into the box, but the house clips into it.
Oh well.

Still learning. Im sure there is a way to get rid of the bad clipping.

Sure there is but would require custom collision solutions. The bounding box has and will always continue to be the first level of collision detection out of the box and every engine since the introduction of the 3d environment has had one. It’s like tires on a car that go round and round. :wink:

The old school way of doing it then was to make sure that the player model fit inside the bounding box and that surface collision was extruded away from the wall.

I doubt though that Epic would implement anything fancy as there are way to many variations of what maybe needed and a custom collision solution not all that difficult to make based on need.

Would be nice if UCX on a weapon was respected though.