How to use js to add an camera target texture to an objects's renderer.materials

Purpose: I could select the screen content in different camera. Like: I press button 1, the camera 1 target texture is on the screen, when i press button 2, the camera 1 target texture is replaced by camera 2's target texture.

What I do: Now i create 3 cameras in different view point. And now i write the script that each one with one camera target texture.

Problem: When I assign the texture to the screen's texture. It get error.

Any solution?

What about changing the view by just move the camera to different position? or any other better suggestion?

Many thansk!

what do you mean by "screen's texture"? If you want to use a render-texture you need Unity pro. If you assign a render texture to a camera (target texture) the camera doesn't render to the screen but into the texture. If you just want to switch between the cameras use `.enabled` to enable/disable cameras. Make sure you only have one camera active that renders to the screen (ie. has no rendertexture)

in edit ~> project ~> render settings you can assign a skybox that what you're after? Or could you post the code that gets errors?