Character Melee attack, socket weapon, enable disable collision

I have a character. The character has a weapon socket for melee attacks. The character has an animation montage for the melee attack. I attach different weapon actors to the weapon socket. The weapon actors attached to the socket have unique characteristics.

How do I manage the collision of the weapon? As it is now, the weapon collision is always on. Which means the enemies take damage from just walking into the characters weapon.

I could cast from the animation montage to the character and cast from the character to the weapon to manage the weapon collision but that seems very inefficient. What is the smarter way to do this? Should I not even use weapon actors?

No, you have the right of it, TinyTracker! You’ll have each weapon animation send out an animnotify, which will then need to be used in the AnimBP Event graph to change the state of the weapon. Typically a simple bool of “CanHurt” or something will work fine.

You’ll use “TryGetActor” to grab the player character, then have the ABP tell the player character run an event to true/false the bool on the weapon. :smiley:

1 Like