I’m using the following very simple code. I got almost all of this from previous answers and, as a result, don’t really understand the limitations of it. So I just want to know it this can work and if so how I can do it. This code is on the plane I want to to display the material on, it has one blank material, a box collider, and a network view.
using UnityEngine;
using System.Collections;
public class MaterialChanger : MonoBehaviour {
Texture2D texture;
bool getPic = true;
void OnPostRender () {
if (getPic) {
texture = new Texture2D (Screen.width, Screen.height, TextureFormat.RGB24, false);
texture.ReadPixels (new Rect (0, 0, Screen.width, Screen.height), 0, 0, false);
texture.Apply ();
GetComponent<Renderer> ().material.mainTexture = texture;
getPic = false;
}
}
}