Setting custom properties to "unset"

Report problems here (or use the built-in feedback dialog in the editor)
Post Reply
totebo
Posts: 5
Joined: Sat Jul 19, 2014 9:14 am

Setting custom properties to "unset"

Post by totebo »

Hi,

Is there a way to "unset" custom properties after you have previously set them? My specific issue is setting the color parameter, then clearing it so it has no value. I suppose this would also apply to boolean checkboxes and maybe other custom properties too.

Cheers,

Niclas
iforce2d
Site Admin
Posts: 861
Joined: Sat Dec 22, 2012 7:20 pm

Re: Setting custom properties to "unset"

Post by iforce2d »

For numeric and string types you can enter an empty string to unset them.

For color and bool types, you need to use script at the moment.
Example:
getBody('body0').clearCustomProperty('mycolor');

If you search for 'clearCustomProperty' in the built-in help you should find a page with some more details on this that might be helpful.
totebo
Posts: 5
Joined: Sat Jul 19, 2014 9:14 am

Re: Setting custom properties to "unset"

Post by totebo »

Great. I get an error, but it clears the color var. The error is:

"Error in ClearCustomPropertyValueCommand"
Post Reply