What do you call a script that is not attached to gameObject.

What do you call a script that does not get attached to game objects, in this script it will do all the calculations. So when your in your game object script you tell the game object script to go to the other script do calculations and returns the data.

I saw it about a year ago, can’t remember what you call it or where to look.

It’s like using a calculator, you stop, get out your calculator, get the answer and continue on your path.

I need an example of how it is setup so I can study up on that. (C#)

Create a class with public static methods. You can call these methods from any other script without attaching this class to any game object.

Example: Utilities.cs

public class Utilities
    {
    public static float GetUsefulValue (float parameter)
        {
        // Do something useful with the paremter and return the result
        return parameter * 2.0f;
        }
    }

Now you can call the GetUsefulValue function from any other script like this:

    float myResult = Utilities.GetUsefulValue(10.0f);

I think what you are referring to is like a

“Library” or “Plugin”

which do what you are saying… like calling its instances or member functions in other script.

Mark solved if your question is solved.

You’re thinking of Static Classes.

Add the static keyword when you declare your class. You will also need to declare your methods as static for the other classes to be able to see them

using System;
namespace Set.Your.Namespace.Here
{
		public static class test
		{
				public static float var = 10;

				static test ()
				{
				}

				public static float DoCalculation (float val)
				{
						return val * var;
				}

		}
}

You’re looking for a static class. I think it does need to be in your Scene that way it’s ‘activated’ but I could be wrong, maybe it can just sit in your Scripts folder.

Check out: https://unity3d.com/learn/tutorials/modules/intermediate/scripting/statics

Then in any script you can call right to it for functions you need. I use this type of structure for my SoundManager I created.