Scripting - Vectors in settings have .W value of 1

If a script has a Vector type setting, its W value will be 1. Often this doesn't matter, but it does if you try to get the length of the setting. If, for example, the user didn't enter anything and it is thus <0,0,0>, it is actually <0,0,0,1> and its length is 1, not 0, as expected.

This is super easy to fix in the editor UI.

My own hack fix has been to set MySetting.W = 0 during initialization.


Please sign in to leave a comment.