Visual Studios says that script doenst exist but it does.

So i started coding in c# and downloaded the standard assets for Unity 5 and Imported the Assets which included tech demos. Like that one scene where you can place flares and makes explosions. Now i took the explosion script and added a public static int which i now want to change in another script. But Visual Studios always says: “The name “ParticleSystemMultplier” does not exsit in the current context” So what im doing wrong?

Here is the script I started to make:
using UnityEngine;
using System.Collections;

public class Test : MonoBehaviour {

	// Use this for initialization
	void Changer () {
        int particlesystemmultiplier = ParticleSystemMultiplier.test;
        
	}
	
	// Update is called once per frame
	void Update () {
	
	}
}

and here the modified ParticleSystemMultiplier script:
using System;
using UnityEngine;

namespace UnityStandardAssets.Effects
{
    public class ParticleSystemMultiplier : MonoBehaviour
    {
        // a simple script to scale the size, speed and lifetime of a particle system
        public static int test = 0;
        public float multiplier = 1;

        public class varchange : MonoBehaviour {int test = 1;}
        
         void Start()
        { if (test == 1) { 
            var systems = GetComponentsInChildren<ParticleSystem>();
            foreach (ParticleSystem system in systems)
            {
                system.startSize *= multiplier;
                system.startSpeed *= multiplier;
                system.startLifetime *= Mathf.Lerp(multiplier, 1, 0.5f);
                system.Clear();
                system.Play();
            } }
        }
    }
}

The class ‘ParticleSystemMultiplier’ has been placed inside the ‘UnityStandardAssets.Effects’ namespace:

//state we are inside the 'UnityStandardAssets.Effects' namespace
namespace UnityStandardAssets.Effects
 {
    //define a class called ParticleSystemMultiplier inside UnityStandardAssets.Effects
     public class ParticleSystemMultiplier : MonoBehaviour

That means to access it from another script (that is NOT inside the UnityStandardAssets.Effects namespace) you either have to explicitly reference it using its full name (including namespace):

//access particle system multiplier using its 'fully qualified' name
int particlesystemmultiplier = UnityStandardAssets.Effects.ParticleSystemMultiplier.test;

Or make use of the ‘using’ statement at the top of your file, to tell the compiler it should look inside the UnityStandardAssets.Effects namespace whenever it comes across a name it can’t find:

using UnityEngine; 
using System.Collections;
using UnityStandardAssets.Effects;

 public class Test : MonoBehaviour {
 
     // Use this for initialization
     void Changer () {
         int particlesystemmultiplier = ParticleSystemMultiplier.test;

Hope that helps!

Note that usually if you hover the cursor over the bad name (will have squiggly red line under it), a question mark (or arrow or something) will usually appear to the left. Click this and VS will suggest potential classes you could be ‘trying’ to reference from other namespaces and offer to fix it. This won’t always work, but often does the job.

-Chris