Search Unity

  1. We are migrating the Unity Forums to Unity Discussions. On July 12, the Unity Forums will become read-only. On July 15, Unity Discussions will become read-only until July 18, when the new design and the migrated forum contents will go live. Read our full announcement for more information and let us know if you have any questions.

Question ERROR:Could not start graph / Could not pause pControl ???

Discussion in 'Getting Started' started by bpmenif, Jun 28, 2021.

  1. bpmenif

    bpmenif

    Joined:
    May 25, 2021
    Posts:
    3
    Hi.
    I'm studying Unity and trying to do a project...

    I designed the program that call the web cam as a material...
    It worked, but I think the webcam conflicts with the my book scanner.

    My Desktop and Unity Environment Recognize the scanner as a camera Since it has a built-in camera...

    If i unplug the Scanner, it worked.
    But If i plug the scanner, the program print a error :

    Could not start graph
    UnityEngine.StackTraceUtility:ExtractStackTrace ()
    bground:Start () (at Assets/Scripts/bground.cs:21)

    Could not pause pControl
    UnityEngine.StackTraceUtility:ExtractStackTrace ()
    bground:Start () (at Assets/Scripts/bground.cs:21)


    ============================
    using System.Collections;
    using System.Collections.Generic;
    using UnityEngine;

    public class bground : MonoBehaviour
    {

    // Use this for initialization
    void Start()
    {
    WebCamTexture web = new WebCamTexture(1280, 720, 60);
    web.requestedFPS = 60;
    GetComponent<MeshRenderer>().material.mainTexture = web;
    web.Play();
    }

    // Update is called once per frame
    void Update()
    {

    }
    }

    ============================

    *Here is my code... and I tried a few ways to solve the problem, but it didn't work...
    (example : Creating a conditional statement based on the camera device name)

    In fact, the program prints out the same error just by connecting the scanner...

    Due to my personal circumstances, the book scanner should always be connected to the computer...
    Is there any way to prevent Unity from recognizing the scanner?
    Or is it possible to solve that problem in software?

    I'd appreciate it if you could reply.
    Thanks...
     
  2. arnesso

    arnesso

    Joined:
    Mar 3, 2015
    Posts:
    96
    This error has driven into crazy.
    Solution in my case:
    Another application used the webcam device, so Unity cannot paused when changed the cam source. So make sure it is not used by another app.
     
    dweeh likes this.
  3. RichAllen2023

    RichAllen2023

    Joined:
    Jul 19, 2016
    Posts:
    1,026
    How many times do you newbies want telling? Use CODE tags when displaying your code!