Trace by Channel help?

I appreciate the help but while trying your demo I noticed a problem.

The player character is able to stand on top of the “enemy” as long as the line trace doesn’t make contact. isn’t what I intended as would result in the player taking damage from the enemy if don’t land near the center of the enemy’s topside in my own game project.

The line trace isn’t supposed to affect enemy contact at all as that’s suppose to be the job of the box trace. The problem I’m having with the box trace in my own game project is that it doesn’t differentiate the direction from which it makes contact with the enemy. then results in things like the player bouncing upward when they come into contact with the enemy from the side, which in turn can kill the enemy if the player bounces upward through them.

The line trace is supposed to prevent from happening by limiting the direction of the box trace onto a downward Z-axis, so that these events only occur when the enemy triggers the player’s box trace by coming into contact from below the player, not from the side or above.

Ok, when you get in contact with an enemy from the side, does your character stand or is he able to roll? With I create a small box somewhere below my character which is always in Z-direction:

Thanks, that actually worked!

I didn’t understood what you meant by my character standing or rolling, so it took me a while before I managed implement your solution.

Unfortunately though, there’s still a minor related issue that I completely forgot about until now that needs to be addressed.

The current solution limits the direction of the box trace to the Z-axis so that the jump collision can no longer be triggered by the player coming into with the enemy from the side, but the Z-axis restrictions do not distinguish up from down. The result is that the player character can damage enemies by jumping up through them, which should not be happening. I tried doing the same thing in some Mario games and does not happen in any of the ones I tried. In those games, Mario can only do damage to an enemy if the enemy collides with Mario from underneath and not from jumping through the enemy.

Is there anyway that I can expand upon the current fix to limit the box trace so that the jump collision will only occur if the player comes into contact with an enemy from above?

Elsewhere, I got recommended solution which I was reluctant to use as it would require a complete teardown of the various blueprints I’m using. Something that I found to be rather excessive as my setup works for me aside from the minor collision issue.

The reason I bring it up is that I was wondering if part highlighted in red:

Could be used into my current setup to fix new issue?

Or is there something else perhaps a bit more basic that I’m unaware of that can be used to fix issue?

You could use GetVelocity and check if the Z value is negative, you could use a GetDotProductTo and check if is in range of -0,6 to 0,6 and you could create a box collision under your character and combine these.

343613-velocity.jpg

Would dot product also work? I’ve gotten it suggested to me a couple of times but I have absolutely no idea on how it works and how to implement it. I tried a watching a tutorial online regarding the subject and only came away more confused.

Unfortunately, I want to avoid using velocity because it would mean that if player is in mid-air moving upwards and an enemy came into contact with the player from below, the player would take damage.

343649-jump-example-4.png

343650-jump-example-5.png

343651-jump-example-6.png

Also, I absolutely want to avoid using a collision box on the player at all costs. When I started trying to implement jump collision, the first thing I tried was a box collision. The problem though was that the box collision couldn’t respond fast enough consistently to prevent the player from taking damage from landing on an enemy. Because of that, I scrapped it in favor of a box trace and since then I’ve preferred to avoid box collision for anything related to player collision.

Okay, I think I finally got it working.

Sorry for the mess but using the highlighted elements in setup makes it so that the box trace is one-way only, thus preventing my player character from being able to damage enemies by jumping through them. You can get a more in-depth breakdown [here][2] starting from the eleventh post.

along with [L1z4rD89][3]'s box trace fix appears to have fixed all of my problems.

Thanks for all the help!