Rounded vector3?

(Alien) #1

The data/values entered don’t match what is presented in the blox canvas. the picture shows an example of where i typed in “-.05” for the vector3 and the value in the blox canvas shows “-.1”. if i put in “-.01” it shows "0 in the canvas.

i setup a debug to determine the value

Self = 0,0,0 (which is what’s in the canvas), not what the new Position is.

everything moves as intended and no errors are produced. this seems an issue in the blox3 canvas.

(Leslie Young) #2

I am relying on the ToString() function to return a string version of values printed in the Block. The vector3’s implementation of it rounds down the values. The same would happen if you were to print the value to the unity console.

Vector3 v = new Vector3(0f, 0.05f, 0f);

result in console:

(0.0, 0.1, 0.0)

I could fix this but then I’d make the canvas rendering slower having to check what value type I am dealing with and whether to manually generate a string representation of it.

(Alien) #3

ok, this isn’t a big deal, since it’s actually working like it’s supposed to. just wanted to make sure it wasn’t a bug.

this should be highlighted or marked in the docs somewhere, or sticky mark this thread, might help others when they see this behavior.


(Leslie Young) #4

Ye… just a cosmetic problem and I do not want to fix it and decrease editor performance in the prcoess. I guess Vector2 and 4, Rect, and Quaternions will have the same issues. Probably Color too.