09-09-2024, 09:26 PM
Actors do not render when manually using Camera.Render() and rendering to a texture. Steps to reproduce:
1. Create actor in scene and place camera.
2. Add RawImage to scene to show camera output
3. Disable camera component.
4. Create script
1. Create actor in scene and place camera.
2. Add RawImage to scene to show camera output
3. Disable camera component.
4. Create script
Code:
public class ObiTester : MonoBehaviour
{
public Camera Camera;
public RawImage Screen;
public RenderTexture SourceTexture;
private void Awake()
{
SourceTexture = new RenderTexture(1920, 1080, 1);
Camera.targetTexture = SourceTexture;
Screen.texture = SourceTexture;
}
private void Update()
{
Camera.Render();
}
}