Announcement

Collapse
No announcement yet.

Melee damage not working

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

    Melee damage not working

    I'm trying to make a basic melee attack system for my game, to test it I was trying to make it so that when you left click a capsule will get all overlapping actors and then apply damage to them. The Damage would then trigger a material change in the enemy causing it to flash red. However the enemy does not seem to be receiving any damage and I have no idea why. Here is the blueprint for the attack, http://gyazo.com/0746b3f9580e4983a79438a242fa5ca7 And here is the blueprint for the damage receive, http://gyazo.com/f7680dcdc21096ced05f930dbeebc875. I would appreciate any help

    #2
    Overlapping actors is probably not an ideal test for what you are attempting to mimic (melee attacks). Overlapping actors in intended more for an actor walking into a trigger of some kind. Try detecting a hit event instead, ensuring that both the capsule and the other actors have their collision set with "simulation generates hit events". Then you can set your capsule to move on the left click event. The moment it moves into the other actors, it will generate hit events, which you can then use to apply damage or trigger off directly to change the material, as shown in the image below, which I just quickly set up to change the material on a box when the player character runs into it.

    Click image for larger version

Name:	Event Hit.png
Views:	1
Size:	110.6 KB
ID:	1080770
    Author of Blueprints Visual Scripting for Unreal Engine
    Creative Director at E-Line Media

    Comment

    Working...
    X