it says the name “particles” not found. nothing helps.
here is the script :
{
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
if (Input.GetMouseButtonDown(0))
{
particles.Play();
}
if (Input.GetMouseButtonUp(0))
{
particles.Stop();
}
}
}
“Particles”. Presumably because you’re calling “Stop” and “Play” on it, it’s a ParticleSystem.
It’s not like Unity can automagically know that your word “particles” is something apart from just an unknown word. You don’t define it in the script and therefore don’t assign it to anything.
Also, your code isn’t even valid C#.
TBH the forums are NOT the best place to try to figure out basic stuff like learning C# etc. I would suggest looking-up some basic tutorials on using C# in Unity and then move onto things like the particle system tutorials etc.
well i tried like this didnt work. after i did this one
void Start()
{
}
// Update is called once per frame
void Update()
{
if (Input.GetMouseButtonDown(0))
{
ParticleSystem.Play();
}
if (Input.GetMouseButtonUp(0))
{
ParticleSystem.Stop();
}
}
}
I’m not sure if you’re aware but it’s worth spending some time on the Unity Learn site. There are “foundational” tutorials to get you started, then you can decide where you want to go next and start learning more complex stuff. If you start too deep, it’ll get pretty frustrating.
Sorry if I’m assuming your knowledge level here but it’s something we see all the time.