Skip to content

CaptureCanvasWithCamera releases its RenderTexture while it's still Camera.targetTexture — console Error on every UI capture #7

Description

@EverSalty

Plugin: Coplay Unity plugin v8.15.1 (Coplay-v8.15.1.dll)
Unity: 6000.x, URP 2D, Windows 11

Every capture_ui_canvas call logs this as an Error:

Releasing render texture that is set as Camera.targetTexture!
UnityEngine.Object:DestroyImmediate (UnityEngine.Object)
Coplay.Controllers.Functions.Implementations.VisualFeedbackFunctions:
CaptureCanvasWithCamera (UnityEngine.Canvas,string)

Cause: CaptureCanvasWithCamera calls DestroyImmediate on its temporary
RenderTexture while that RT is still assigned as the capture camera's
targetTexture.

Fix — clear the target before releasing the RT:
camera.targetTexture = null;
RenderTexture.active = null;
// then DestroyImmediate(rt) / ReleaseTemporary(rt)

Impact: cosmetic (capture still returns valid pixels) but it spams the
console with Error-level entries on every UI capture, which masks real errors.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions