RenderPipelineManager.endCameraRendering only affects ViewPort-camera

I subscribed to this event in order to render healthbars onto multiple cameras in the game, however the LookAt function only affects the Viewport camera in the scene-window. Even if I close the scene-view, it doesn’t work. Shouldn’t it affect the cameras in the scene?

void RenderPipelineManager_endCameraRendering(ScriptableRenderContext context, Camera camera)
    {
        foreach (var healthBar in healthBars)
        {
            healthBar .transform.LookAt(camera.transform);
        }
    }

Okay, nevermind I fixed the problem. For anyone reading this in the future: I just had to build the game. Turns out that for some reason this didn’t work while in the editor.