Search Unity

AddExplosionForce accuracy problem. Rounding error maybe?

Discussion in 'Scripting' started by tenth, Apr 26, 2015.

  1. tenth

    tenth

    Joined:
    Nov 27, 2012
    Posts:
    5
    All right, say I'm looking at my scene along the Y axis (from the "top" perspective) and I have an object at the (1,0,0) position (right of center). I set off an explosion just the the right of that, at (1.5, 0, 0) and the object moves exactly to the left along the X axis. Everything's fine so far.

    Now I do it again, but I set off an explosion at (1.5, 0, 0.2), just above the last one, and the object moves exactly to the left again, along the X axis. It should be moving at an angle in the down-left direction, but it isn't. I've found that it works this way as long as the Z component is 0.2 or less. At 0.3 the object will move at an angle as expected.

    Can anyone explain this behavior? Do I need to write my own AddExplosionForce method?
     
  2. tenth

    tenth

    Joined:
    Nov 27, 2012
    Posts:
    5
    Nothin'? No ideas? This would be easier if I could see just how the methods are written, so I'd know exactly what it is that AddExplosionForce is doing.