In Unreal Engine you can create a Lightsource and a Cable and then parent them together so that when the cable is moved the light source will always be at the end of that cable.
This can then be used within Blueprints to create many different effects.
In this tutorial by Unreal Dev Hub, explore how to create a physics enabled lamp to light up your environments.
