Hi everyone,
Is it possible to change the skybox in runtime? I have found ways of managing cubemaps but not for adding them to the sky. Do someone know how to do this?
Thank you a lot
Hi everyone,
Is it possible to change the skybox in runtime? I have found ways of managing cubemaps but not for adding them to the sky. Do someone know how to do this?
Thank you a lot
Hi @practicas_imas,
You can set your skybox cubemaps at any point using the following method:
https://developer.playcanvas.com/api/pc.Scene.html#setSkybox
Itās available on the active scene:
this.app.scene.setSkybox(this.cubemap.resources);
where is that āthis.cubemap.resourcesā assigning an specific cubemap? it is
this.cubemap.resources.*NAMEOFTHECUBEMAP*
you have to assign it as an attribute? or is it another thing?
So this.cubemap
is a cubemap asset and resources
is the property you need to pass.
Yup, it worked
Thank you!
This is not āsolvedā and the linked project does not exist.
I have 6 skybox faces. How do I, using script only, create a ācubemap resourceā? pc.cubemap() does not exist. Iām unclear how to do this in code, can anyone please provide a working example?
see this example: PlayCanvas Examples
search for āloadFacesā there. That should work for what you need.