Hello,
I am trying to dynamically change the camera’s clearColor using something like this with no success:
this.entity.camera.clearColor.r = 0.8;
Do we need to use an update function or something similar?
Hello,
I am trying to dynamically change the camera’s clearColor using something like this with no success:
this.entity.camera.clearColor.r = 0.8;
Do we need to use an update function or something similar?
try this
var newcol = new pc.Color(0.8,0,0,0);
this.entity.camera.clearColor = newcol;
You need to set the entire color for the attribute change to be registered.
e.g.
var color = this.entity.camera.clearColor;
color.r = 0.8;
this.entity.camera.clearColor = color;
Thank you both, now it works correctly.
Best regards,