I am learning Amazon Sumerian for Web VR development. I am trying to change the color property from the script of that entity in the update()
method. The code looks like this:
function update(args, ctx) {
ctx.entity.transformComponent.setTranslation(0.6, 166, distance);
distance += 10;
if (distance > 1500) {
distance = -10;
ctx.entityData.color = "blue";
}
}
I have tried setting the color
property by ctx.entity.color
and ctx.entity.setAttribute('color', 'blue')
too but that also doesn't work. I also couldn't find any documentation on their official site for setting color. I think there is a simple catch that I am missing.
What is the correct way to update color of an entity from a script?