getComponent

I have a character.
A child object of this character is a pivot containing a particle emitter.

private var pe : particleEmitter = GetComponentInChildren(particleEmitter);

Why does type “particleEmitter” not denote a valid type?
I guess I am interpreting it wrong.

Where do I enter the name of the child object it needs to look in?
And what type should it be?

Thanks

ParticleEmitter is with a capital ‘P’.

The thing to get used to is when you are referring to a type or class, it is uppercase (ParticleEmitter) but, as it looks like you were thinking, when you are referring to a component of your object directly, it is lowercase because it is technically a variable of your object(myObject.particleEmitter).

But making any GetComponent calls or any type declarations require the uppercase frist letter.

Hope that made sense. :wink:
-Jeremy

doh! That was stupid of me :slight_smile:
Must be the hot weather.

Thanks for the tips!