0 votes


ich have this:

var test = 0.0

func _process(delta):
test += delta
stepify(test, 4)

when i print test i get in the first step a number like
when I use stepify its the same.

Does anyone have an idea what I'm doing wrong or how I can do it so that only the full seconds are displayed?

Many Thanks

in Engine by (12 points)

1 Answer

0 votes

stepify does not modify its arguments because they are numbers, instead it provides the result as a return value.
However you might not want to apply this to test directly because that would cause the tiny difference added by delta to be lost.
If you want to see the stepified result, you can write:

print(stepify(test, 4))

Which should give you a result like a bunch of 0 for 4 seconds, then 1 until 8 seconds, then 2 etc.

by (28,735 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.