Jump to content
  • Advertisement
Sign in to follow this  
Somar

How to make a monitor?

This topic is 849 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Greetings gamedev.net,

 

I today was wondering how I would go to make a monitor display the image being captured by a camera in Unity.

 

[spoiler]explanation_zpsst0eiraa.png

[/spoiler]

 

I don't want to replace the main camera. In fact I want the main camera to be able to see this footage from a second camera.

I know that it is advanced Unity working. I have read it in many articles, but I didn't found any tutorial on doing this. Any help?

Share this post


Link to post
Share on other sites
Advertisement

Render to a texture, and apply that texture to the monitor.

 

My internet is being super shoddy due to bad weather, or I'd try to find some links. Googling based on what I said should get you started.

Share this post


Link to post
Share on other sites

I will provide a bit more detail, but it is Lactose! said.

 

1.  Make a new Render Texture in the project folder.

2.  Make a material, probably something either with an emission texture, or for texting purposes use the Unlit/Texture shader.

3.  Drag the Render Texture into the texture of the material.

4.  Make your plane(or if you already have UVmapped geometry) with that material, so you can see the render texture.

5.  Make another camera, pointing wherever you want it to.  Take the AudioListener component off of the camera so you don't get errors.

6.  On that new camera, drag the Render Texture onto the "Target Texture" of the camera.

7.  Profit?!?!

 

That is all I did, took less than a minute in my project to just add it in really quickly.  It even works and updates in the editor too.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!