Topic was automatically imported from the old Question2Answer platform.
Asked By
JulioYagami
I knew a function that did this.
Depends. The first answer, (using abs) will make the value positive wether it is negative or positive already. The second answer (is value > 0) will check to see if the value is positive or not. Either one could be right depending on how we interpret your question.
This works but Godot wants this number to be a float. so it will complain about NARROWING_CONVERSION. It’s not a big problem but I can’t help but wonder if there is a method specifically for integers