How to load an asset from a non-Main class

I was wondering how can you use assetManager to load assets from a class other than your Main class. I tried :



[java]

import com.jme3.asset.AssetManager;



public class whatever {

public void method() {

AssetManager assetManager = new AssetManager();



}

}

[/java]



but this gives me the error : com.jme3.asset.AssetManager is abstract; cannot be instantianted



how can I properly use assetManager to load models, textures, etc. from non-Main class?

Pass the assetManager variable from the main application.

1 Like

Ok thanks worked like a charm.