+1 vote

As far as I'm concerned GDScript doesn't contain floor() and/or ceil() functions, which currently I am in desperate need of for a mechanic. What's the best way to go about implementing these?

in Engine by (53 points)

2 Answers

+1 vote

Just to add to mrLogan's answer, as a general rule you can use the Search Help feature on the top-right of the script editor as a quick and easy way to check if a function exists in GDScript.

Just type the name of the function there and it gives you back all the places where it exists (if it does). In this case it's from the GDScript base class, although other objects also have their own floor() and ceil(), like Vectors, for example.

by (196 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.