Jump to content

What.......the hell....


Recommended Posts

You're updating distPerc once, and only once, at the top of your onLoop() method. This is the root of your problem.


You need to update both of them in your onPaint() method.



I had them in onPaint before, same problem.



I DON'T KNOW HOW but putting it back in onPaint fixed it! thanks so much guys!

Edited by Paradox68
  • Like 1
Link to comment
Share on other sites

I had them in onPaint before, same problem.


In the image that you posted, this is the issue.


distPerc was never being updated after you start the script, however you are updating currentDist in your onPaint() method. This would lead to the Distance: display on your paint showing correctly, however the percentage display is stuck at the original calculated amount at the start of the script.


As everyone else is saying, you also need to make sure you're casting at least one of the variables in your distPerc calculation to a double (either currentDist or startDist), so that it performs floating point multiplication. This is for accuracy purposes.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...