# Can we create same name class for different objects in unity?

I have four similar objects in my game. As they are all similar therefore I have created a single script that defines mash for all of them. The script that defines mash for these objects uses a variable called radius which I have imported from other file (by classname.radius). The radius updates on every frame and it is the only property that is different for all objects.

To allow different radius for different objects, What I thought would work was, making four different classes of same name classname. Creating variable radius in all of them and giving them different values. Dragging first file to the first object, second file to second object and so on.. When executed, every time the script that generated mash considers classname.radius from the file which is dragged to that object. But that isn't working. What is wrong and how can I implement it?

Seems I'm messing with OOPS concepts!

• It seems you should try learn the basics of C# (or whatever language you're using for Unity) first. This is a basic question of scope, classes and objects. – Gustavo Maciel Jun 3 '15 at 12:08

The script that defines mash for these objects uses a variable called radius which I have imported from other file (by classname.radius).
So this means your variable radius is static? But since you want it to be different for every instance of your object, why do you have it as a static variable? Why not just make the variable not tied to the class, but to the instance of the class.