I’ve set up some code to change the color of a point when it’s clicked on (thus selected). I won’t cover the specific code that enables the change on click, but I will show the code that’s changing the colour:
if (entityClicked) {
viewer.selectedEntity.point.color = Color.WHITE
}
This is what the entity looks like before clicking.
But when it’s clicked, it goes red instead of white:
The code used when making the point in the first place looks like:
const point = viewer.entities.add({
name: "ExampleName",
id: "ExampleName",
position : worldPosition, ///Example position
point : {
color : Color.BLACK,
pixelSize : 10,
heightReference : HeightReference.RELATIVE_TO_GROUND
},
ellipse : {
semiMinorAxis : 5000.0,
semiMajorAxis : 5000.0,
material : Color.YELLOWGREEN.withAlpha(0.3)
}
});
What could be causing this to happen? This happens regardless of the color of the ellipse.