title: How to change the Canvas Render Camera via C#
body: <p>I have two camera. One which is the main camera and another that follow an object. </p>
  
  <p>The main camera is attached to a canvas with HUD and other GUI Text stuff. When I change the camera to the object that need to be followed, I loose the canvas. I clearly need to change the Render Camera inside the Canvas component.</p>
  
  <p><a href="https://i.stack.imgur.com/MfAyA.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/MfAyA.jpg" alt="enter image description here"></a></p>
  
  <p>I've tought that something like this would exist</p>
  
  <pre><code>canvas.GetComponent&lt;Canvas&gt;().renderCamera...
  </code></pre>
  
  <p>but it's not. So how can I change the render camera via script?</p>