Explanation for Video 139's Jittering Tanks Bug

I was just watching the video about this bug and I have an explanation for the jittering effect. If you take a look at the collision used for the turret and barrel, you’ll notice that the barrel’s collision encompasses the entirety of the barrel, including the portion of the barrel that is inside of the turret. The physics engine, during gameplay, is trying to push the turret and barrel apart such that one object will not be inside of another. Over time, the amount of force being built up results in the entire tank to fly off.

So, how do we fix this? The easiest, albeit ugly way, is to pull the barrel outside of the turret itself so that the collision meshes aren’t intersecting each other. It’s not really a good solution, but it is one. The better solution would be to remove the collision geometry from the barrel, then add a capsule collider that you can place and scale such that it only covers the barrel itself, leaving the portion that’s intersecting with the turret alone. Because the intersecting portion is so close to the turret itself, you would barely notice when the tank is hit in that section.

6 Likes

Thanks Kevin, we will revisit this later, and indeed creating a separate collider to prevent self-collisions is a solution.

thanks, that fixed it!

Collision Settings for UE v4.12 Bouncy Tank - check out this thread in a previous discussion for the collision settings I used.

Hi Guy’s, All that will work. I just feel like i should share a contribution as well.
I had to deal with it before watching the video, because I didn’t know when we’d be doing it during the classes, which are great by the way, big fan…
It seems that the root actor takes every child actor which has the Auto-Weld option ticked into a single collision mesh, it simplifies things for the engine on the physics level. Thus, if you have a moving part, it has to recalculate the bounds, center of gravity, of the whole root in case the part has auto weld ticked and has moved inside the main actor body, etc…

Also, there can be secondary collisions solved by making any moving parts to ignore certain Object Types(You can mess with them in the Project Settings-Collision). So unticking autoweld from the Barrel and turret, and telling them to ignore collision with the root = TankBody, you can solve this, I think, 100%. Also they should ignore collision with themselves(Turret/Barrel).

Mine seems to be free from the problem. It was indeed a mystery at start, because it doesn’t log collision messages on the console. So my guess is that It’s no collision, it has to do with collision bounds/center of mass being recalculated at every tick the barrel moves.

1 Like

Privacy & Terms