Hello Everyone,
In the PG below, the “Most Value” button will create a line that should always point to the sphere with the highest value. Value is assigned randomly at first, but clicking on a sphere will increase its value by 1. However, if you increase a sphere’s value to give it the new highest value, the line will not link to the new sphere.
As the code is written now, I know the line will only switch when the button is pressed. I’ve tried many variations of true/false statements and new variables with no success. If you remove the button from the equation, the line will update automatically.
To summarize: The line should only appear when the button is clicked, and then move to a new sphere if that sphere’s value becomes the new highest value.
https://www.babylonjs-playground.com/#4UUDKU#8
Thanks in advance for any help or recommendations!