Categories
Advanced and Experimental 3D computer Animation Techniques Project 2

Week 8 Continue Write gargoyle blueprints and fix bugs

This week, I focused on fixing the issues related to the gargoyle’s physic mimics after death, and continued working on the attack damage detection system for the gargoyle enemy.

Physical collision problem:

Another issue that took me quite a bit of time to deal with was the gargoyle’s physical collision. After enabling simulate physics, I noticed that the gargoyle’s body would twist and rotate unnaturally, and the collision response was inaccurate. This is because UE5’s default physics collision is automatically generated based on the skeleton, which often doesn’t work well, especially for complex models like this one. The calculated collision volumes frequently don’t match the visual appearance of the mesh.

To fix this, I had to manually adjust the collision shapes for each bone, making sure their forms matched the model more closely. Although this process was time-consuming, the results were much better. The corpse no longer clips into the ground or flails around unnaturally:

0:00 – 4:17 : edit physical collision

There was also another small but important detail: bullet impact force. Since bullets in my game travel fast and carry a lot of impulse, if the player kept shooting after the gargoyle died, the corpse would sometimes get launched or spin wildly into the air. It looked like the body just disappeared under fire:

To prevent that, I set the Mass value of the gargoyle’s physical asset very high. This way, once it enters the death state, it stays grounded and barely moves, even under heavy gunfire. It simply collapses and remains in place, without being knocked across the room by the player’s attacks.

Attack detection:

4:17 – end : write attack detect blueprint

For attack detection, I followed a similar approach to how I handled zombies. I created two Blueprint classes: one for Attack Start and another for Attack End.

These blueprints are used to get the socket locations of the bones at the beginning and end of an attack. Since the gargoyle sometimes attacks with its left hand and sometimes with its right, I couldn’t hardcode the detection logic in the character blueprint:

I added a sphere trace node, using the socket location as the center. This allows the detection area to be a spherical range around the attacking bone, and I can adjust the radius based on the actual attack reach. Once a hit is detected within that sphere, the damage is applied using the Apply Damage node.

In the gargoyle’s animation asset, I added a second notify track since the first track is used for attack sound effects.

On this second track, I inserted the previously created Blueprint classes for Attack Start and Attack End at the appropriate moments in the animation. Because attack damage detection happens every tick while it’s active, keeping it running constantly would be too performance-heavy. By placing these notifies only during the wind-up and impact portions of the attack animation, I can limit the calculation to just the moments when it’s actually needed.

Lastly, in the animation notify, I copied the bone names from the elbow to the tip of the middle finger to ensure accurate tracking during the attack.

Leave a Reply

Your email address will not be published. Required fields are marked *