Surface Impact during Interact (Chopping a tree)

gdespaux

New member
I'm trying to add animations and interactables where my character can chop down a tree. I've added the animations in, added a Hatchet as a Melee Weapon (Really wasn't sure what else it could be) and added an Interact ability to trigger the proper animations. Everything looks good and works, even have the UI working to show when the player is close enough to a tree to hit it. But the only thing missing is that the Hatchet's `Surface Impact` event never seems to fire. I added a Trail as well and neither of these work. Is there any way to have these trigger during interactions, and not just when "Used" as a melee weapon?
 
Unfortunately your interact animation is likely not triggering an actual collision between the melee weapon and the tree, so if you needed similar functionality (sound effects/decals playing on hit), you'd probably have to time that manually yourself, for example by sub-classing AnimatedInteractable and expanding on the Interact function.

A different approach here would be to allow the melee weapon to hit the tree directly by using it rather than via an Interactable. You can use the OnObjectImpact callback event, as described on this page, on the tree to detect when it's hit by a particular weapon. (Come to think of it, I wonder if that event would get called during your interact animation - worth a try?)
 
Thanks, I can give that a shot!

I was confused on how Surface Effects work, I guess. The weapon does physically (virtually?) make contact with the tree, the colliders themselves do collide. I was hoping that Surface Effects/Impacts would trigger anytime collisions occur and not just when scripted through the "Use" ability or similar.
 
Top