public Transform target;//your cube or player
public Vector3 offset;//offset))) change value in editor
///
void Update()
{
this.transform.position = target.position+offset;
}
public RenderTexture renderTexture;
// Save Texture as PNG
void SaveTexturePNG()
{
Texture2D tex = new Texture2D(renderTexture.width, renderTexture.height);
RenderTexture.active = renderTexture;
tex.ReadPixels(new Rect(0, 0, tex.width, tex.height), 0, 0);
byte[] bytes = tex.EncodeToPNG();
Object.Destroy(tex);
File.WriteAllBytes(Application.dataPath + "/../SavedScreen.png", bytes);
}
главное не забудте из под угрока/куба вытащить) чтоб была самостоятельным объектом)
ну и ссылки все назначить и тд)