I wrote a script that is supposed to start the particle system when you push the w key down and to stop it when you pull it up. I keep getting these errors:
Assets/Splash.js(6,32): BCE0020: An instance of type ‘UnityEngine.ParticleSystem’ is required to access non static member ‘Play’.
Assets/Splash.js(12,32): BCE0020: An instance of type ‘UnityEngine.ParticleSystem’ is required to access non static member ‘Stop’.
Here is the script:
function Update ()
{
if (Input.GetKeyDown ("w"))
{
ParticleSystem.Play;
}
{
if (Input.GetKeyUp ("w"))
{
yield WaitForSeconds (1);
ParticleSystem.Stop;
}
}
}