Hi, so ive run into this problem and honestly don’t have any idea whats going wrong. would love some advice on what might be happening and where I can look for answers.
so I’m trying to slow the zombie’s walk speed when turning. So I want to compare the look vectors in a loop with the previous look vector and see if is within a certain tolerance for being the “same” direction.
in my code I don’t understand why line 13 and 14 contradict each other
I’m pretty sure it’s because Vector3 values purposely don’t represent super small numbers (probably past the hundredths is where there’s no more representation)
okay, stupid i didn’t test this but i didn’t need to have it accurate, I just removed the divide and kept them as integers and it works properly now. Still don’t understand the problem tho.
that happend because that is how floating-point numbers work and how computers handle them and i think that roblox do math or smt with the input in vector3 that is why they lose precision
but amnot completely if roblox does that
floating point is a 32(single precision) or 64-bit (double precision) and its a datatype that can have decimal numbers you can see the vid on the top to know why that happens