Hi, i am curious on the following code:
mainEngineParticles.Stop();
audioSource.Stop(); //if not hitting space, stop audio
we define AudioSource audioSource; in the beginning of the script so that we can use it later on to code for audioclip to play/stop:
public class rocket : MonoBehaviour
{
[SerializeField] float rcsThurst = 150f;
[SerializeField] float mainThurst = 100f;
[SerializeField] AudioClip mainEngine;
[SerializeField] AudioClip success;
[SerializeField] AudioClip death;
[SerializeField] ParticleSystem mainEngineParticles;
[SerializeField] ParticleSystem successParticles;
[SerializeField] ParticleSystem deathParticles;
Rigidbody rigidBody;
AudioSource audioSource;
But when we are coding for particle system, why do we not define anything for particle system just like what we did for audio source? I am confuse on the difference of implementation on audio-source and particle system.
If i want to manipulate other component of game object in the future, how to see if we need to define or not?