selectedEntity causing a TypeError

I'm using Cesium 1.5, and I'm trying to select a billboard like so:

- set up a new ScreenSpaceEventHandler
- give it this input action:
     viewer.selectedEntity.billboard.rotation = 30.0;

So when I click on the billboard, it appears in the console with the change I made. Then Cesium produces an error message: TypeError: property.getValue is not a function.

For the record this happens no matter what property I try to change. Scale, color, everything causes a TypeError. Am I using incorrect syntax to get the billboard, maybe? I don't know why it doesn't seem to like rendering the change I've made.

In Cesium 1.6, your code will work as is, but for now, you need to manually wrap your value in a ConstantProperty. For example:

viewer.selectedEntity.billboard.rotation = new Cesium.ConstantProperty(30.0);

In order to read the property back, you need to call getValue (this will still be true in 1.6)

var rotation = viewer.selectedEntity.billboard.rotation.getValue(time);

We are making huge improvements to Entities in 1.6 (available on Feb 2nd) to make all of this easier. I’m also in the process of writing a detailed tutorial on Entities and the property system in general, which will hopefully help get everyone on the same page and paint the big picture.