If Object Exists?

Feb 8, 2010 at 10:43 PM
Edited Feb 8, 2010 at 11:11 PM

is there a way to check if a component exists?

im going to use "marker" objects to populate a terrain with scenery(trees/shrubs), and i want it to be universal, but also "toggleable" (new word) so that if the markers arent built in the scene editor, the engine wont search for them, causing an error.



edit - if i use one of my *AWESOME* (cough), custom created models, and load it in, its black, as if it has no lighting, what am i doing wrong.



Feb 9, 2010 at 1:30 AM

hey bubz~!

Engine.ContainsComponent should do fine :)

I really can't tell from here what might be wrong with your model. If you like, you can send the model to me and I can check it out. You might first try opening the model up in the DirectX viewer to see if it appears as you expect.


Feb 9, 2010 at 6:47 AM



heres the file in its context. the file "cube.x" is one model that im having trouble with and the file www.x has similar problems, both look ok in dxviewer.

thanks mate (sorry for messy code) :)

Feb 9, 2010 at 4:49 PM

The model is certainly going to render black without any diffuse texturing. Neither XNA's out-of-box BasicEffect nor Ox's standard effects use the vertex Color property for rendering, so the color you apply to mesh parts isn't going to apply.

Just use uv diffuse texture mapping :)


Feb 9, 2010 at 7:22 PM

well, thats a lot of work for sure :D now im an expert in lithunwrap and softmod :) thanks for the pointers mate