How to access varibles on a newly instantiated object

I want to instantiate an object and then vhane one of the variables of the newly instantiated objects but Instantiate only returns an object of the class Object which isn’t what I want as far as I understand from all of the instructions i’ve seen

Is there any way to asign the variable during instantiation or afterwords?

Look at the second example in the documentation for Instantiate, which sets the velocity of a newly instantiated object.

Try something like this:

MyClass newClassObject = Instantiate(myClassPrefab) as MyClass;
//Now you can access variables and functions on 'newClassObject' as any MyClass object... as long as your 'myClassPrefab' was a real prefab with a MyClass script attached to it