When the distance vector between the mouse coordinates and Mover is zero, the calculation results in NaN as it tries to normalize() it. (Blank screen is displayed.)
I found normalize_or_zero() in the docs and this would be great alternative for the case.
When the distance vector between the mouse coordinates and Mover is zero, the calculation results in
NaN
as it tries tonormalize()
it. (Blank screen is displayed.)I found
normalize_or_zero()
in the docs and this would be great alternative for the case.