You can use Custom Depth with a Post Process Material: Post Process Materials | Unreal Engine Documentation