How to instantiate an already created object that exists in another file?

Hi, I’m trying to avoid having all my created objects in the same file I want to use these objects in. I have a file called “FlowFields” and in another file, I have a “Particle” object that I want to use in my FlowFields file. I tried just instantiating the object normally like:

Particle particle = new Particle();

This only works if I have the code for the object inside of the main file FlowFields. For the record, both of these files exist in the same folder on my computer.

Help appreciated!

Thanks.

1 Like

Just hit this button, create a new file (tab) and start to write your class code inside :

2 Likes

Well that’s a bit embarrassing. I swear I did that in my last project and it didn’t work…

Either way, thank you! It worked this time as intended.

I don’t know either.
Have a great day :smiley: