0 votes

I knew a function that did this.

in Engine by (663 points)

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.

2 Answers

+4 votes
Best answer

abs(value) is the way
Docs

by (699 points)
selected by
+1 vote

check is > than 0

by (78 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.