Melee Weapon / On Object Impact not firing

forzabo

Member
Having trouble getting my equipped melee weapon to trip the OnObjectImpact event. Read and re-read the docs, and the related posts here -- must be something very basic I'm missing though, because what I'm trying to do is very vanilla.

One item of confusion though -- the Melee weapon inspector has a slot for a callback for the OnObjectImpact event -- I've left that blank, assuming it's meant to be a global callback to be called whenever there is an impact with this weapon.

Otherwise, I've copied the sample script from the docks and added to my simple target object. The melee weapon seems to have a valid collider and appears to impact the target when watching from various perspectives in scene view. I'm stumped.

Attached minimal scene to repro.
 

Attachments

  • repro_scene_melee.unitypackage
    389.5 KB · Views: 6
Are you using version 2.1.5? The docs have been updated to this version and the event was changed compared to version 2.1.4. When I tried your scene there weren't any items equipped.
 
Yep, I'm using 2.1.5

I just tried the package attached above in a fresh project. It works for me. The Character is equipped with a paintbrush. The target item is a fence (it has no material in the package, I deleted it for size, just assign the default material)

1564
1565
1566
 
Oops, we're up to 2.1.6 now. This version has the new callback. If you are running 2.1.6 and it's still not working does a breakpoint get called if you place it on line 757 within MeleeWeapon.HitCollider?
 
Top