Trying to have my player pawn wield a sword. Traditional weapon attacks are NOT working.
Instant hit effects don't travel through more than one enemy, so if you've got a bunch of foes in your personal space it only attacks the first one it hits. Furthermore it only works in a direct line from a designated point; it is not very useful for the sweeping range that one should have with a sword.
Projectiles don't quite work either; I'd need one super fancy projectile to match the curve of my sweep, and even then it only works if the player stands perfectly still and doesn't get interrupted by anything.
I've snooped around and found tutorials that perform traces between two bones in a mesh, thus a system that can detect when something passes through the sword. But this is insufficient because it sets the bounds too small for this project.
I'm not making Way of the Sword here, nor some complex combo-driven system; the sword attack will just be a one-button deal with just one swipe. As such, I need the attack range to be a little generous to compensate for aiming that the player cannot perform. A thin line of detection isn't enough, and honestly a static collision hull affixed to the mesh is only slightly better.
I think what I may really need to do is generate an animated 3D shell that will be invisible in the actual game. It needs to be animated so that it can start off small, fill the range of the sweep, and cut its range to where the sword is at any given moment (plus buffer.) It would need to be tied in with the player pawn so if the player is moving the sweep doesn't remain standing where the player was.
So that would be:
-Mesh that inflicts damage upon contact, being able to contact multiple objects but each object is contacted only once per animation.
-When not in use mesh either becomes inert or completely disappears
-Mesh moves with player pawn
-Mesh can be forced to vanish in the middle of its animation (if attack gets interrupted because player got hit from behind, etc)
-A different animation (or possibly a different mesh) can be called. (Crouching and jumping may need slightly different attacks, and a longer sword will become available later.)
This seems like a tall order, and I don't really know where to begin. I don't even know if I am going about this the right way.
Any thoughts here? Is there a better way to accomplish this end goal, and if not, how do I create this stuff?
And I also suspect that it would be easier to animate the mesh using vertex animation so I can fine-tune the exact shape of the hull. But if I did that how do I handle proper attaching? Everything in UE3 is centered around bones for attachment.



Reply With Quote




Bookmarks