0 votes

Hello,

ich have a object with some methods. The code works perfectly but in the code editor the members and methods are not autocompleted when i type dot. Any idea why this ust not working or how i can switch it on?

Thanks a lot! Stefan.

in Engine by (17 points)

Godot's autocomplete is a little erratic for me too sometimes. Typically, closing and reopening the script or Godot itself fixes the issue for me.

1 Answer

+1 vote
Best answer

If this is a custom object, I'd guess it's related to the fact that you may be using dynamic typing in your script. For autocomplete to work, you'll have to use static typing in your code.

See this related thread:

https://www.reddit.com/r/godot/comments/bem9k7/how_to_make_code_editor_autocomplete_variables/

And the docs:

http://docs.godotengine.org/en/3.2/getting_started/scripting/gdscript/static_typing.html

by (10,896 points)
selected by

Thanks a lot jgodfrey! Dynamic typing was the "problem".

Changing

var ppm_player = CPixelPerfectMovement.new(TICK_AMOUNT, Vector2(0,0))

to

var ppm_player:CPixelPerfectMovement = CPixelPerfectMovement.new(TICK_AMOUNT, Vector2(0,0))

did the trick. Now autocompletion works like a charm.

Perfect! Greetings Stefan

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.