i’ve been trying to replicate the code which play sound into the particle system.
like this:
parameters
[serializedfield] audioclip finishAudio;
[serializedfield] particlesystem finishParticle
cache
audiosource aSource;
particlesystem pSystem;
void start{
aSource = getcomponent():
pSystem = getcompoenent()
}
oncollisionenter
case “finish”
playAudio();
playAudio(){
aSource.play(FinishAudio);
pSystem.play(finishParticle);
}
Why do we instead just call for the Parameter variable(finishParticle.Play()) instead of getting the component first and parsing it through the Parentheses like the audioclip?