UI on cameras spawn during runtime

I am making a game in which all the characters (robots) are going to be completely modular, meaning that every body part is going to be removable, including all cameras. This also means that my game doesn’t have anything on the start; it only has one GameObject “player”, with a script for adding of the prefab based objects into the scene. The thing is, the UI elements don’t seem to render on cameras spawned during runtime. Is there a way I can make the Canvas render on a specific camera via script or some other way?

You can use the Screen Space - Camera of the Canvas of your UI as RenderMode. You then need to set the Camera for the UI in the Render Camera field.

I’m not sure why your UI wouldn’t render on your Camera if using Screen Space - Overlay tho when instancing without more infos. Instancing it shouldn’t pose a problem.
132186-capturescreenspace.jpg

Following comments, you can edit the Render Camera field using a script : Unity - Scripting API: Canvas.worldCamera