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().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…