Small newbie type question

Hey everyone,
New to unity, new to the forum :slight_smile: I know C++ and php quite well so can understand most of the javascript, however I must have forgotten the following. Can you please tell me what this means:

Taken from the Lerpz tutorial:

var SFXRespawnActivate: AudioClip;
or
private var emitterRespawn1: ParticleEmitter;

I see we are defining a var or private var called SFXRespawnActivate and emitterRespawn1. But
1.What does the colon mean?
2. What is AudioClip or ParticleEmitter? (Is it an object??)

Thank you!!!

the : you put between variable names and the type of variable. the AudioClip an ParticleEmitter is the type of variable. a Transform is an object, a GameObject is a GameObject, an AudioClip is an audio clip, a ParticleEmitter is a particle emitter, a Rigidbody is a gameobject with a Rigidbody attached.

ah right… thanks a lot!! I guess if it said ‘int’ or something like that it would have been clearer to me. I assume though there should be some kind of object relating to something like a ParticleEmitter for all the settings (like color etc). Just having something as a ParticleEmitter type I assume is just so you know it’s a ParticleEmitter as opposed to something else, would this be a correct statement? Where would all the details of the ParticleEmitter be stored?

Thanks!

A ParticleEmitter is a particle emitter.

Scripting Reference

Having something as a specific type means it is that specific type. You can’t say “particleEmitter += 7” becaues you can’t add seven to a particle emitter.

Cheers mate! :slight_smile: