So for a while now I’ve been trying to implement a way to take out enemies by jumping on them Mario-style without the player taking in the process for a long while now. After many, many failed attempts I finally found some success by using a Box Trace by Channel but while jumping on enemies now appears to work as intended, there seems to be an unfortunate side effect of setup.
When the player character comes into contact with the enemy from the either side, the player will be bounced upwards into the air. The bouncing itself is almost certainly being caused by the Jump & Bounce event I made, which causes the player bounce off the enemy when they land on them. The giveaway being that the “bounce” sound effect plays when the player makes contact with the enemy. event is only supposed to be triggered when the enemy comes into contact with the player’s underside from down below.
My only assumption as to why event is being triggered when isn’t supposed to be is that the box trace I used for the jump collision isn’t limited to the downward Z-axis and instead triggers when the enemy comes into contact from any angle.
As a result, I was wondering if there’s any possible way that I could limit the trace to exclusively a downward Z-axis so that it won’t trigger when the player comes into contact with the enemy from the side, only from above.
As always, any help whatsoever would be greatly appreciated!
Rather than just a collision, how about a downward trace which requires the enemy to be below the player by a certain distance. The way, you can avoid the problem of a general purpose collision just triggering whenever you get near something.
So, always doing a downward trace of a certain length, but when it hits, check the distance between you and the opponent. It has to be in a certain range to call the damage event.
Also, put a DoOnce node in the enemy damage routine ( I don’t know if you have ), so that it only gets called once. Reset it when you’re ready, don’t bother if the opponent has been destroyed.
So here’s my setup. Yes, I know its a giant mess that needs to be greatly simplified, however at point in time I don’t know how to simplify communicating with multiple different blueprints.
Anyways, the jump collision is completely borked when it comes to the enemy blueprints, my player character takes damage from landing on an enemy without doing any damage to the enemy itself. However, if I substitute the box trace with a line trace like in your example, then the jump collision still works with the balloon blueprints I made but the enemy ones. The problem though with using a line trace is that I get all kinds of collision issues with the balloons unless the player lands dead center on top. is why I was using box trace to begin with as the line trace is simply far narrow to work properly. So unless there’s a way to widen the line trace then a box trace has to be the way to go.
Rather the problem appears to stem from something related to the Break Hit Result Location stuff, as jump collision still works with the balloons which are not connected. In contrast, the two enemies are connected and they’re the ones where jump collision isn’t working.
So, do your box trace as usual, just like before, but also use my line trace code, but just to print out the results ( was there something under you, what was it, how far ).
Then play the game and jump on stuff and generate your error, whilst looking at the output from the line trace, and see if you can find a way to use the line trace to solve your problem.
I’m sorry but I don’t know how to set up the line trace from the box trace in order to do as you asked. As I said before I don’t have much knowledge on how to make tracing stuff work.
Okay, since I have absolutely no idea on what I’m doing, I just decided to apply most of [L1z4rD89][1]'s line trace blueprint into my jump collision setup just to see what would happen.
The good news is that the jump collision didn’t end up breaking but it didn’t fix the trace collision problem. On top of that, I’ve noticed that the area of the jump collision box trace has shrunk with my player character taking damage from jumping on the enemy if they land off-center.
I’m sorry but I really, really don’t know anything about setting up traces and I am completely lost.
So BOX could be a little bit bigger than your character. When BOX is overlapping another actor (like my GOOMBA cube in hte example) it scores or fires. Then you whant to know, ok the BOX overlapped an actor, but is he also under me? Like :
I tried implementing your line trace setup as best as I could but I still can’t get the line trace to work. The plus side is that I’m not having any other collision issues pop up but my character is still bouncing off enemies, killing the enemy in the process, which shows that the line trace still isn’t working at all.