I was inspired by this video • Video (which is very likely also computer generated) and tried to reproduce some of the concepts with UE4.
UE4 uses PhysX for physics simulation. PhysX is designed to simulate real world physics and not "ideal" physics, so the system dissipates a bit of energy over time even with all damping/frictions turned off. Eventually the pendulum slows down a bit. You can see the effect of it in the Bloopers at the end of the video. ;-)
Watch video UE4 Fun with Physics - Unreal Engine 4 online without registration, duration hours minute second in high quality. This video was added by user Marco Ghislanzoni 26 February 2018, don't forget to share it with your friends and acquaintances, it has been viewed on our site 4,081 once and liked it 97 people.