Hello, i have a magnetic katana that works like a whip, and i am trying to combine it’s attack animation made in blender with physics, but it keeps crashing every time i try to enable physical animation, and if i try to simulate physics without physical animation it crashes after 20-30 seconds.
the physics asset doesn’t have an issue, Animation blueprint has just an idle animation looped, and the attack animation is just a montage playing when left click, i tried to make it following this video: Physical Animation: The Ultimate Starter Guide [UE4/UE5]
If both Physical Animation and standalone physics simulation eventually crash, I’d first suspect a physics/constraint setup or collision issue rather than the attack montage itself.
A few things I would test:
Test the Physics Asset by itself. Open it in the Physics Asset Editor and simulate it without the Animation Blueprint or montage. If it crashes there, rebuild the problematic bodies/constraints.
Check the constraints carefully. For a whip-like katana, make sure the linked bodies have sensible angular limits and that no constraints are creating extreme forces. Start with a very simple chain of 3–4 bodies and add segments gradually.
Check collision settings. Disable collision between adjacent bodies in the chain. Self-collision between neighboring segments can create unstable physics and eventually cause a crash.
Test without Physical Animation. Get the physics asset stable first. Then enable Physical Animation with a low strength/stiffness value and increase it gradually.
Separate the animation test from the physics test. Temporarily remove the montage and use only the idle animation. If that is stable, add the attack montage afterward. This helps determine whether the transition from animation-driven bones to simulated bones is causing the problem.
Check the skeletal hierarchy. Since the katana behaves like a whip, make sure the bone chain is continuous and the Physics Asset bodies correspond correctly to those bones. A bad hierarchy or unusual bone transform can cause instability.
I’d also try a very small reproduction: 3–4 bones, simple capsules, simple constraints, no self-collision, no montage, then enable simulation. If that works, add the remaining segments one at a time. That should make it much easier to identify which body or constraint is causing the crash.
If it only crashes after 20–30 seconds rather than immediately, I’d pay particular attention to unstable constraints, collision feedback, and rapidly increasing velocities rather than assuming the montage is the cause.
Hi again, thanks!, i tried everything you said and i think i’m close to solving it but not sure.
So what actually happens is: whenever the katana is attached to something with animations(or something that changes the katanas transform constantly) it crashes.
İ tried it without attaching to anything, and it works perfectly fine, attached to camera it works perfectly fine, bu not when it’s attached to the character with idle or attack animation.
Also made the root bodies to be kinematic but it didn’t work.
Crash log:
Assertion failed: (Index >= 0) & (Index < ArrayNum) [File:D:\build\++UE5\Sync\Engine\Source\Runtime\Core\Public\Containers\Array.h] [Line: 1067] Array index out of bounds: 2 into an array of size 0
Found the solution, i just needed to make the physical animated asset to be pre physics tick group and the skeletal mesh parent should be post physics.