Character collision: horizontal impact doesn't produce reaction movement

Hello, I’m using a character and a big amount of its MovementComponent settings are equal to the ones in the sidescroller template.

So here’s the problem I want to solve: when a character is pushed away with “Launch Character” and hits a ceiling / vertical WorldStatic actor, it rebounds as expected (his impact with the WorldStatic actor causes a reaction that moves the character in the opposite direction). However, if the impact is horizontal, also with “Lanch Character”, when hitting the WorldStatic wall the character just stops, there’s no reaction to the impact as one would expect.

What could be causing that there’s a nice reaction to vertical impact but none at all for horizontal ones?

Any ideas?

Hello,

(Adding this as a comment rather than answer, as I’m sure there is a better way to do it).

You could play with something like this to get started I suppose:

I threw this in the Side Scrolling Template and was getting the character to bounce off the walls a little bit (you’d have to tweak it to get the desired result). You could also look at the FPS and Ball Rolling Templates for using an Impulse Effect perhaps.

Edit: If you are looking for more a long the lines of wall jumping… check this out: UE4 Wall Jump - YouTube

Just some thoughts,

-W

Thanks a lot, Wes. I’ve implemented something similar to this but that uses Add Impulse if character’s mesh is simulated. I’m having a single problem, and is that when going into a wall the printing returns both Ground and Wall results, and don’t know why (it gives only Wall results when colliding to a character). Also, there are bad results on some ramps (seen as Walls) so I’m trying to find another way to get if it’s a wall or the ground, the best way would be accessing the angle of the surface, but I haven’t figured out how yet. I’ve checked out the Normal but is not what can solve this.

Hey Albert,

Taking a second look at this, I think a better way to handle this would be using a Trace node instead of Collision Overlap.

You could try this instead. This will trace forward 50 units in front of the player (you can adjust this as you see fit) and return whether something was hit or not. Since we are not using the Hit Result for anything other than checking if we hit something, we don’t need a Break Hit Result tied to the Out Hit, only the Return Value is used as the 1st Branch Condition.

In playing with this a little, I noticed the issue you were talking about when going up ramps (which should be fixed by using a Trace anyway) but as a double check, you can add the second branch to only launch the player if they are falling (presumably from a jump or dropping down from a ledge and falling into a wall).

Still, this only pushes the player back… if you are wanting control for jumping upwards there would need to be a bit more adjustments made to this script.

Hope this helps,

-W

Hi again, here I show a way to detect if the character is colliding with wall or ground when Hit event is processed. This gives the expected results: the bool filtering with “Don’tProcessHitAgain” prevents having multiple undesired Hit calls at a single time (which happened before against walls, colliding many times at once). I think is better to set up this in Hit instead of in Tick calls with tracing for performance.

It works even in ramps, the only case in which it isn’t good yet is in the fact it detects ceilings as grounds, but a simple comparison between character’s mesh’s center of mass and the impact point Z locations would be enough to filter it as wall or as a ceiling, depending on how one wants to set it up.

As far as I’ve tested it seems to work nicely with characters in weird, wild rotations like ragdolls.