Here is are 2 problems I met with the melee weapon collision. I would like to solve 1 of these problem. But if I can solve both, I will be much more confident in learning UE4.
Imaging that I’m doing a bloody game, a melee weapon cut through the enemy shall leave bloody decal on its trails.
The configuration for the attack character looks like:
And the collisionSword is attached into a hand socket of Mesh.
When the attack happens(by doing an animMontage), at the victim side’s blueprint, I first try to deploy onComponentBeginOverlay to get impact point and speed vector.
The hit or overlap does fire normally. (Thus I think I’m doing right with collision channel.) But unfortunately, for both, they all return (0.0f,0.0f,0.0f) somehow. So
1st question:
Why the vectors are not there?
Then I try to move on by getting velocity of collision box for the weapon. But again, it’s all 0.0f as well.
2nd question:
Why does the blueprint fail to learn the velocity of my collision box from another blueprint, while it can get mass somehow?
Hi,
I had same problem, when collision overlap returned me 0 0 0.
This happens when your collision boxes/spheres are in themselves, lets say cube is IN sphere. Overlap is ONE point, but cube in sphere have unlimited overlapping points so system really dont know which one of them have to return. So collision must start when these points are currently not overlapped. I had problem when i shooted projectile inside of pawns body, so it returned me 000, so i solved it by branch if overlap=000 then i used sphere location (i used this for spawning fx effects…)
Let me know if this helps, if not post some gameplay screen and ill chect it more detailed.
I really appreciate your suggestion and wish I can bring you some good news.
Here are what I tried:
I reduce both the attacker & the victim’s collision box to 1. And ignore all collision into themselves whenever it happens. => The overlap/hit triggers, but still all 0s in sweep result.
I sit back and add a overlap-aware simple box mesh. => The overlap/hit triggers, still all 0s in sweep result.
Here is the test video @
Please share more of your experience about what could be missing…
This is exactly what i said when you are attacking, your sword is in that box… i think your sword damage collision is activated only when you press “attack” so at that time sword is already in box… try to activate sword cube collision at begin play, and go to near box (try to hit that box without attack) , you will see if that return some values… try it
Thank you for your reply again.
I try your suggestion, and it works this time.
But what I really have interest is about the velocity vector and hit location during attack, in order to do something like bloody decal or ragdoll.
Do I have any other options?
I can now get the initial impact point by other approach,
I guess it would just be easier to pre-define a speed vector and pass it to the victim on hit.