0
Answered

web cam texture

tasos bakas 12 months ago updated by dabreaka82 6 months ago 4

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...

Hi Guys,

what's the reason, that it doesn't work on a Lit/Unlit Shader from the LWRP?
Is there a simple Solution?

My Bolt Version is 1.49 in Unity 2019.2.13

Thanks for help :-)

Cheers,
Marco