Reasons for -1.#IND ?

This forum is currently in read-only mode.
  • hi,

    i am wondering about the possible ways to (inadvertendly) set a private variable to -1.#IND (undefined, i presume). i've got some simple TimeDelta-related math in a project, and it occasionally results in objects becoming invisible when their angle property is being calculated as -1.#IND

    since the math is really simple, i've got no idea where to start looking. does somebody know the possible causes of this error?

    ( the cap is here. click & drag to scratch. occasionally bugs out, especially in debug mode & with unlimited framerate )

  • It means you've done something mathematically impossible. Like divide by zero, take the square root of a negative number, et cetera. The object disappears if the angle, width, height, x or y is this value, because it is impossible to determine how to render the object.

  • superfast! thank you very much! i'm guessing it is divide by zero, i'll have a close look.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • A good way to fix a divide by zero is to ensure that the number you are dividing by is over 0 before performing the arithmetic operation by inserting a condition "Value to divide by > 0". This might be common sense, but this is a note for anyone else that gets stuck on this and can't figure it out.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)