# Object´s scale is decreasing less than expected

So object B is moving, let´s say, 4 units to left. There is object A, which will be squeezed that exact distance. So if its scale is 10, - the 4 units will be = 6. As simple as that, but for some reason this isn´t working. Am subtracting the exact same distance object B is going through, but even though object A´s scale decreases, it decreses less than expected, like 3 instead of 4. That number is accumulating over frames.

I have verified several times that the number subtracted is indeed the correct number, and the script that makes this is executed after object B´s movement. Any ideas of what could this be?

Edit: I have discovered something. Instead of just subtracting the 4 units, am also subtracting the value of how much is going through, which I get using raycasts. Now, the interesting part is that, even though this number should be 0, is something like -0.002… and is no longer accumulating, but it still becomes bigger and bigger (I think this is because the number is a percentage from the size reduction, which becomes bigger every frame). This is less noticeable than before. The raycast is thrown before the movement itself, so I think that am subtracting the extra value of the former frame. And the moving object is supposed to stop for a frame before going through. Why the moving distance isn´t enough?

Scale is not number of units, it’s a multiplication of size.

If your object, lets say cube for simplicity is 1x1x1, then a scale of 10 makes it 10x10x10
However if its 1.2x1.2x1.2, then a scale of 10 makes it 12x12x12.

So if we remove 4 from the scale of the first example, we get the expected size 6x6x6.

However in the second example we get 7.2x7.2x7.2 - not 8x8x8 as you may think.

If we have a smaller than 1 size, lets say 0.8x0.8x0.8 then the decrease would be less:

0.8x0.8x0.8 scaled by 10 = 8x8x8

Minus 4 from scale = 0.8x0.8x0.8 scaled by 6 = 4.8x4.8x4.8

The result is a size reduction of only 3.2, less than the 4 you would expect if thinking that scale is size.