Apply Render Texture To Camera Via JavaScript - Help


I'm trying to make the target texture of a camera dynamic via JavaScript. How would this be done?

So far I have added a script onto the camera and I have two variables:

var TurretCam : Camera;
var targetTexture : RenderTexture;

How will I tell JavaScript to apply the render texture to the camera?

Thanks, Ollie

TurretCam.targetTexture = targetTexture;