I’m looking for help since I always have collisions issues and I never understand anything about them in UE. Each time I try something, there’s always problems. And I don’t blame the engine, I blame myself for not understanding it.
So, here’s my problem, hope sombedoy can help me.
I’m using the TopDown example.
What I’m trying to do :
- Create a box where, each time my character overlap it, it allows me to click on it and apply damage to the enemy, then destroy it. To simulate Actionrpg/heack’n slash kind of things.
So. It works with a simple mesh, but not all (Because if I’m using the cube, each time I destroy it the collision remains invisible and I can’t walk over for some reason…) But now i’m trying to replicate things to a pawn (Character Bleuprint)
But… It doesn’t work. For some reason when I launch the game it tells me that I’m overlaping the box collision even if my character is far from near the enemy.
It’s my fourth attempt to make it work.
I added some screenshots for trying to make it clear for everyone.
As you can see in Overlap2, the box collision is not the problem here. It works perfectly fine since my string clearly say : Overlap when I’m… overlaping it… And EndOverlap when I’m stoping to overlap it.
BUT. I can destroy rocks, but not the guy… And I can’t figure why. Aaaand it drives me crazy.
And as you can see in my first Overlap screenshot… When I launch the game, it says “Overlap” 2 times… But I’m not even near the enemy !
Could someone give me a hand here ? It would be soooo appreciated.
Thanks by advance.
I think the issue is happening because you have not casted to you player actor.
So, grab the other actor and simply cast to your player character BP. Also make sure that box is set to “overlap only pawn”
Hi, thanks for the answer. But If I don’t make mistake here, draging something from “Other actor” on “On component begin overlap” won’t help here since my trigger/collision box is not the problem here.
The problem is that I can’t hit my target, the enemy, for some reason, but it works on the rocks…
But maybe I misunderstood what you were saying.
According to this line as you said
But now i’m trying to replicate things to a pawn (Character Bleuprint) But… It doesn’t work. For some reason when I launch the game it tells me that I’m overlaping the box collision even if my character is far from near the enemy.
So, I would suspect is that the enemy(pawn) is causing the overlap event to happen. I might be wrong in understanding your problem, but, it is always a good idea to cast to, to what you want to trigger that event. In this case, the input should be enabled only when the player gets in the box, and disable when going outside the box, by casting first before enabling input you ensure that something else cannot do it. It is worth a shot. And a good practice.
You’re right btw and I wasn’t looking things in that way… And you genuinely solve one of my problems who is that, when I launch the game there is multiple overlap even if I was not in the box…
But, anyway, I still can’t hit him with my mouseclic; I’m going to look further by myself.
Thank you Mr Sho, it was very helpful !
Does anyone ever had the same issue ?
Is that because it is an actor, a character or something ?