Hi Tom,
I was following the variables in Debug and as I said, the returned value was 110.596 or whatever it was. It definitely wasn't zero, but the subsequent 'mag = 1/mag' returned Inf. I'll have to run a test if there's a difference with assigning variables in an expression to itself within the main code and a function...
But thanks for the error-trap reminder. I'm assuming that won't happen with collision detection but I ought to have that check. I ought to have a lot more exception checking I guess!
I was following the variables in Debug and as I said, the returned value was 110.596 or whatever it was. It definitely wasn't zero, but the subsequent 'mag = 1/mag' returned Inf. I'll have to run a test if there's a difference with assigning variables in an expression to itself within the main code and a function...
But thanks for the error-trap reminder. I'm assuming that won't happen with collision detection but I ought to have that check. I ought to have a lot more exception checking I guess!