I don’t know what is going on but when I type print(Vector3.new(-1,-2.9,-2))
in the command line, and then the output gives (-1,-2.900001,-2)
what is going on?
I think he meant the random decimals shown up in the output, my guess is this is a usual floating point error
ah if its just float point error, is there anyway to stop this since it’s a little extreme
1 Like
It isn’t extreme. There is no difference between -2
or -2.0000
.
I think I am just going to probably truncate the text, yea thanks though!
1 Like
What you can do is capture the Vector3
value in a variable and each component’s decimals through the use of math.floor
.
local vector = Vector3.new(0, 5, 0)
local x, y, z = math.floor(vector.X), math.floor(vector.Y), math.floor(vector.Z)
print(x, y, z)
1 Like