I know there are a number of similar questions but I have read all the ones I could find and none of the answers have helped. I am trying to load objects from a .x file and then load a texture from a .bmp file (the texture format is not important I can easily change if .bmps don't work). The models are loading correctly and I am adding some texture coords from the file. The models weren't textured in the 3d program I made them in though so the problem could be here. Anyway the end result that the models are all just white. The texture isn't showing up. Here is what I am doing:
var image = new WWW(imagePath);
yield image;
image.LoadImageIntoTexture(currentObject.renderer.material.mainTexture);
As you can probably see the code is pretty standard and basically just copied from the docs. I get no errors at any point during the process of loading object and texture. I am out of ideas.
// Get the latest webcam shot from outside "Friday's" in Times Square
var url = "http://images.earthcam.com/ec_metros/ourcams/fridays.jpg";
function Start () {
// Start a download of the given URL
var www : WWW = new WWW (url);
// Wait for download to complete
yield www;
// assign texture
renderer.material.mainTexture = www.texture;
}
This is fromt he API, it takes the image at that URL, and downloads, and makes it a texture...
I just noticed that this has 1000 views and the answer is not really even here. the answer was .BMP is not a valid file type for www images. If you are having troubles that do not involve .bmp files then I apologise for wording the questions so generally. I have added a note to the title so that people with a million different problems don’t all end clicking on this and being disappointed that it doesn’t help.