WEBCAMTEXTURE won't build as a mac app.

I’m using a trial version of Unity 4.3 PRO on a mac with mavericks.
Trying to track down a strange build error.

function Start () {
var webcamTexture : WebCamTexture = WebCamTexture();

webcamTexture.Play();
Debug.Log(webcamTexture.isPlaying);
}

This is the only code I’m using and I’ve attached it to the main camera. Simple.

I can run it in the editor and it plays fine. Cam light comes on. No Problem.
I can build a web player version. Same. No Problem.
I can build a PC version. Same. No Problem.
But when I try and build a MAC version (universal or otherwise) I get this build error:
Assets/NewBehaviourScript.js(4,29): BCE0018: The name ‘WebCamTexture’ does not denote a valid type (‘not found’).

How can this be?

???

Can anyone help me. It’s driving me crazy.

Thanks.

Try changing:
var webcamTexture : WebCamTexture = WebCamTexture();
To:
var webcamTexture : WebCamTexture = new WebCamTexture();

Did so.
Still the same error on a mac build. Remember, it runs and builds on every other platform (PC, web etc). And runs in Unity no problem.
It also builds perfectly in Unity 3.5.

Very odd, like the type is just not recognized by the mac compiler:

Assets/CAM.js(4,29): BCE0018: The name ‘WebCamTexture’ does not denote a valid type (‘not found’).

If that doesn’t work then try this

var webcamTexture : WebCamTexture;
function Start () {
webcamTexture = new WebCamTexture();

webcamTexture.Play();
Debug.Log(webcamTexture.isPlaying);
}

If it continues I would say just send a error report to unity because I just install maverick on my macbook pro and I am using the webcamtexture and it builds without any problems.

I am using a pro trial. 4.3. But that hasn’t been a problem for anything else.
Thanks for the help.

Here is something I built as a test : Blink activated! http://thejab.com/GAA3
(if you want to use the spacebar, click into the window first)

I tried the other code you posted.
Still the same problem, only when building for mac.

It might have had a problem on the install I downloaded so I’ll try it again. Thanks.

J

O yea I haven’t test my app with Unity 4.3. I tested my app with Unity 4.2 and it seems to work.

4.3.2f1 to be exact.

http://unity3d.com/unity/whats-new/unity-4.3.2

–Eric

Oh, well there is that.
Thank you sir.

J

That does seem a little bit overkill.
For example, I make camera projects directly for advertisers, hospitals, kiosks etc. So I build straight to OSX. Killing the whole mac build side just because of the app store is silly.

It’s a temporary measure until they can implement a fix properly, and it’s not silly because many people (who don’t use WebCamTexture) need to build to the Mac app store (not the iOS app store) and needed a solution now, not later. You can just download a previous version and not use 4.3.2 if you aren’t going to submit to the Mac app store.

–Eric

Understood.
I also noticed that apple changed the internal architecture of the cameras. They no longer have them on the high-speed bus on newer machines. Most of the hi-spec machines since July 2013 are like this. Including the machine I just bought. (This is confirmed on Macbook airs and pros).

Any news on this? This is a show stopper for us and it does not seem to have been fixed in 4.3.4.

Ben

Is there any official word on this yet?

As Unity pro user since 2007, it is the first time where i am little annoyed with Unity :

“4.3.2 : Disable WebCam support in MacStandalone as it was using newly-deprecated APIs, which made publishing to the Mac App Store impossible. Web Cam support in mac standalone will come back in a future release.”

Well well 4.3.3, 4.3.4 -----> 4.5.1 This does not still seem corrected.
Any news about this “future release”? Is WebcamTexture will be available soon on OSX without this boring message :
<< Video Capture is not available on this device. Make sure you are running iOS 4.0 or newer >>

Sorry, I don’t like to cry. Help…

What’s new in Unity 4.5:

  • Mac: Rewrote Mac web cam support to use AVFoundation framework, so you can publish to the Mac App Store without using deprecated APIs.

–Eric

yes, i saw that but… this don’t work for me (OS X 10.6.8). I suppose that AVFoundation framework have change since 10.7…

finally, confirmation after some tests : Use of AVFoundation framework for WebcamTexture works very well on OSX 10.9.4 WebcamTexture available on OS X > 10.7 only.

Thanks a lot Eric.

1 Like