Hello. If I create a class in a script, dont use scriptRegistry, how do I access it and create an instance in another pc script? For example import/export
You can’t use modules (import/export) in PlayCanvas scripts.
But any global class (available in the window context) can be referenced and instantiated in other script files.
Can you explain a bit more on what you are trying to do?
I have class. I don’t want to create it via pc.createScript. There is a second script that is created via pc.createScript and attached to entity. How do I get access to the first script, in the second. In C# I would use namespace for example. In js + webpack would connect the script via import/export.
Now I just created a class in one editor window. It works, but I want to physically split the scripts into two files.