CollectComponent.

Editor
Feb 26, 2010 at 8:32 PM

Hi mate, im using

Engine.CollectComponents<Units>(treeList);

to collect the positions of all trees in an area so that i can reference them to an npc.

the trees are of Type unit, and there are around 300 of them, they are initialised by

public class Units : StandardModel,ICollidable

so they are not a componentscript as far as i can see

but the collectcomponents line just gives me a list with zero length

thanks

bubzy.

Coordinator
Feb 26, 2010 at 10:07 PM

I think it's possible that you're again accidentally querying the engine for objects before you've created them. Check this first, I'd say.

Cheers!

 

Editor
Feb 26, 2010 at 10:20 PM

actually i wasnt

its way more embarrassing than that. sorry.

i was collecting the wrong component type.

sorry for stupid post :D