The first of 16(!) animated gatehouses I've gotten permission to do from admin for my Acteon castle-Town
It works by using structure blocks to "load" "frames" of the build (each block being 1 frame)
The gates are opened by default, can be closed from a lever within the gatehouse and when left in their open state close automatically at night, so long as a player is in the area.
They will also all be able to be controlled from a master switch in the keep, although with no chunk loading on bedrock the state of the gatehouse will still only change when someone's nearby.
This is actually kinda a benefit because it means even if I'm offline my gates appear to be manned and will close on or open for you when you walk up to them sometimes.















