0
Answered

web cam texture

tasos bakas 5 months ago updated by Lazlo Bonin (Lead Developer) 5 months ago 3

Hey guys!

Absolute noob here, so forgive the possible obvious mistake I've made here.

I'm trying to recreate Unity's script for web cam texture (which I've tried and it works), with Bolt. Here's the original script and here is the flow I've created - but it doesn't work. I've tried a few things, but I'm obviously missing something essential. I can see that the camera starts working (light turns green when I press play), but the texture of the game object doesn't change. Any tips?

Thanks!









using System.Collections;

using System.Collections.Generic;

using UnityEngine;



public class ExampleClass : MonoBehaviour

{

void Start()

{

WebCamTexture webcamTexture = new WebCamTexture();

Renderer renderer = GetComponent<Renderer>();

renderer.material.mainTexture = webcamTexture;

webcamTexture.Play();

}

}

Bolt Version:
1.4.4
Unity Version:
2019.1.5
Platform(s):
Scripting Backend:
.NET Version (API Compatibility Level):
+2

no worries, done. 

Let me know if you think there's a better way...