How to Load png in assets in Niantic Studio Custom Component

Hello!

I’m creating a custom component for Niantic Studio.

I am trying to use an image placed in assets with fragmentShader of shaderMaterial, but I don’t know how to load the image named sprite.png in assets.

In THREE.TextureLoader(), I have to load the image in . /assets/sprite.png or /assets/sprite.png, but it says there is no URL.

As shown in this query, I added // @asset to the schema of ecs.eid, but I cannot select the asset. When I added // @asset to the schema of ecs.string, I can select the asset, but it would just be treated as text.
What should I do?

Hi!

Take a look at the code in our Scavenger Hunt sample project that shows how to use asset references and load textures from the project to apply them on a 3D model.

1 Like

Thank you very much!
It’s works :grinning_face_with_smiling_eyes:

1 Like

This topic was automatically closed 4 days after the last reply. New replies are no longer allowed.