How to set an entities layers in script

How do I define exactly what render layers an entity should use in script?

Lets say I want to completely change an entities render layers at runtime. How would I do that?


Hi @Grimmy,

Here is an example:

const worldLayer ='World');
const customLayer ='My Layer');

this.entity.render.layers = [,

1 Like

See the recommended set up:


Works perfectly. Thanks!

1 Like