Making an Enemy With a Chain Weapon

I don’t know if this is the right place to post this, so if this doesn’t belong here I’m sorry.

I’m making an enemy, a boss to be specific, that wields a large chain with a spiked ball. The chain is dynamic, and each link has a Rigidbody and a configurable joint connecting it to the next link. Now I want to make the enemy use this properly as a weapon. And that’s hard.

The problem is that physics objects, especially things like chains, are highly unpredictable in how they move. So when the enemy performs an attack animation, swinging the weapon over his head or swiping it across the ground in front of him, the weapon barely reacts. I tried to fix this by adding forces to the spiked ball’s Rigidbody, but the results only became more unpredictable and it simply looks unnatural and ugly.

Does anyone have ideas of how to make this work? I know that a chain weapon should preferably be done with pre-made animations and no physics, but I really want to make this work. If I do manage to make a physics-based chain weapon that works properly, I think the result will be so much better than otherwise. Better visually and gameplay-wise. So please, does anyone here have advice on what to do to make it work?

Have you ever wielded a chain based weapon? They are pretty hard to get right in real life too. Simply swinging a weapon over the head or sweeping it in front of you won’t do much. Chain weapons are often characterised by being swung around in circles first to build up momentum before striking.

Perhaps build a training rig where you can test different movement patterns and measure their effectiveness. Iterate on this to figure out the key parameters. Then adjust the key parameters until you have an effective weapon.

1 Like

Imho especially for a bossfight it would be beneficial to make it a premade animation. If it is random it will be hard and possibly frustrating for the player to dodge from attacks. It is a rather well established rule that bossmonsters have patterns which can be learned and attacks that can be dodged. I don’t see how more randomness and unpredictable physics behaviour could make this more fun. If it was a weapon the player wields that might be different.
My suggestion would be to try if you can get the chain to simulate properly in your animation software and export the baked animation to unity so that you have something that both fits your requirement of looking realistic and also is predictable enough to avoid player frustration.

1 Like

oh man i love chain weapons. i have no idea how the physics works… but all the best on figuring it out!! ;)

1 Like

Yeah, that just sounds like a nightmare. A nightmare on the CPU. A nightmare to design. And a nightmare to implement effectively.

I think animations are the way to go.

IDK, maybe try doing some motion capture of someone using a chain weapon?

Okay, I think I got it now. I set the Fixed Timestep to a lower value in Project Settings, so now the chain behaves like a chain. Instead of glitching out or move unnaturally when the enemy swings it, it actually swings properly. Naturally it comes with the cost of lower performance, but at least right now it’s not even noticeable.

2 Likes

If it works it sounds great. I would think an easier way to accomplish it would just be through art and animations as mentioned above. I’d just picture the whole chain as essentially a whip/rope in that you have a centreline that guides the overall configuration and move the links through the animation as necessary.