Announcement

Collapse
No announcement yet.

Hit event just wont work

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Hit event just wont work

    I'm trying to create a melee combat system. However, event hit just won't work and overlap does not return me the information i need.
    The hit event from the weapon(blade channel, custom one i created) just trigger if it hits the capsule component(Pawn preset) but it never triggers when i hit the Mesh(Mesh Channel, custom one i created). However, the hit event on the capsule(Pawn) works, but triggers extremely "badly(sometimes it just won't trigger)"
    Overlap seems to work fine.
    I'm doing the "same"(the difference is mostly the collision channel) setup for my projectile and works perfectly, so i don't know what i'm doing wrong.
    Here are the screen shots from the projectile, blade , capsule and mesh channel i'm using.
    I also all kind of different setups for the collision and it wont work(the mesh collision is set to overlap the blade channel but i used the block option aswell), even using the same collision and channel type as the projectile. And yes, i tried setting "block" the blade channel on the mesh, it won't work aswell. I can guarantee that the weapon mesh has a collision setted.

    EDIT: I'm using animations to try a hit on an enemy, but with/without animations hit seems to not work.

    Capsule :
    Click image for larger version

Name:	Capsule.PNG
Views:	1
Size:	31.0 KB
ID:	1216561

    Mesh :
    Click image for larger version

Name:	Mesh.PNG
Views:	1
Size:	31.6 KB
ID:	1216562

    Projectile :
    Click image for larger version

Name:	Projectile.PNG
Views:	1
Size:	31.7 KB
ID:	1216563

    And the Blade(Melee Weapon) :
    Click image for larger version

Name:	Blade Collision.PNG
Views:	1
Size:	31.1 KB
ID:	1216564
    Last edited by Ivan de Souza; 04-14-2017, 10:15 PM.

    #2
    Your ignoring the pawn
    Inphidel / Brian - Developer of Ultraball
    http://www.ultraballgame.com

    Don't shy away from bugs in your game. Don't play it as intended. Break your game so you can fix it!

    Comment


      #3
      That's the purpose. The pawn is the capsule. I don't want to hit the capsule, i want to hit the mesh. This method works perfectly fine with my projectiles but won't do anything with the sword. I think i said that already?

      EDIT:: I've done some more testing. I added a projectile movement to the weapon and the hit works perfectly fine. The problem apparently is entirely on using animation to move the weapon and generate the hit event. Any idea why and how to fix, or if this is the problem?
      Last edited by Ivan de Souza; 04-14-2017, 11:33 PM.

      Comment


        #4
        afaik a hit event requires at least one rigid body simulating physics.

        (There may be ways to bypass this using kinematic actors and special flags)

        But, in general, for melee type weapons driven by animation, it is often better to use line trace or sweep out the shape manually.

        But if you really must use overlap or hit events, make sure to use ccd.

        Also note the animation may skip many frames, so you will not necessarily have a smooth arc.

        Rama has a melee plugin you can buy:
        https://www.unrealengine.com/marketp...-weapon-plugin
        https://www.casualdistractiongames.com

        Comment


          #5
          I followd your advice and i'm using a line trace for the sword collision. Seems to work fine now. Unfortunatelly i can't buy the plugin because i don't have a credit card... bad luck for me xd

          Comment


            #6
            Glad its working :-)

            For future reference, it looks like as long as you use "Sweep" when moving, then a non-physics body will still generate rigid body collisions.
            Under the covers, this is implemented as an underlying Physx sweep of the shape.
            https://www.casualdistractiongames.com

            Comment

            Working...
            X