|
(script edited since initial post to show the script in its entirety) Hey, I'm new with Unity and I'm having a bit of trouble. Here's what I have
I assigned the grass texture via Unity's Inspector interface so that's there. (I realize the math is off for what x,y,z I decide to put in, but I figured I can put those in the right place once I know a bit more about what I'm doing) So that's basically it, I just can't seem to figure out what's wrong with it as to why the texture won't show on the cubes. (I should clarify that I can actually see the cubes lined up across the screen, they're just purely grey) (Also, after I started this, I found out that I could've made a prefab and cloned it via script to do this, but I figured I started this way, so I'd like to know why it's not working)
(comments are locked)
|
|
Is that your all code for the instantiation and texture assignment? If it is, you should add the rest of the code for a c++ script: I've you do it it works perfectly, at least for me This looks exactly like what I have, I edited my first post to show my script in its entirety. I even attached a light source to my camera in case I couldn't see textures because of lack of light. Is there some other property of a cube or something I have to enable before textures are visible on it? I should also say that I attached my script to a blank GameObject.
Jun 28 '11 at 07:46 PM
claudekennilol
(comments are locked)
|
|
Try this: I did this and changed my texture to a material and used Unity's Inspector window to attach the texture to the material. Now all the cubes the scripts populates are pink as if they're missing a texture altogether. It's odd because if I just place a cube on the screen and drag the texture onto it it works just fine when I hit the play button (or when I did this and dragged the material onto it). Is there a special place the texture needs to be? I just have it in the root of the Project window 'cause I'm more worried about learning/getting it to work than being organized.
Jun 28 '11 at 08:18 PM
claudekennilol
(comments are locked)
|

I edited it to show the whole script.. for some reason I can't get all of it inside a code block..
Redid it on my desktop with the same code, but I had a different texture, it worked this time.. I'll see if I can't figure out how to close this.