Texture to Texture2D

Hi, i’ve got Texture object and i need to read it’s pixels but to do that i need to convert it to Texture2D and then use GetPixel. My question is how to convert it, i’ve tried
(Texture2D)texture - it said “cannot cast from source type to destination type”
texture as Texture2D - here i get null pointer exception

Have you tried Texture3D ? You can read pixels from Texture3D as well.
Texture is the base class.

For webcam textures, you should be able to get a pixel array using GetPixels:

Color[] textureData = webcamTexture.GetPixels();