Tooltips/Hints exposed in the editor

Godot Version

4.5 b6

Question

In my code, I’m trying to place hints on my exposed variables, but no matter what information I find and try i always come back to this error:

# --- Target ---
# The node path to the player or target the camera should follow.
@export var target_path: NodePath

# --- Mouse control ---
# Mouse sensitivity for orbiting the camera
@export_range(0.001, 0.02, 0.001) var sensitivity: float = 0.006

# Invert horizontal mouse movement
@export var invert_x: bool = false

# Invert vertical mouse movement
@export var invert_y: bool = false```


ERROR: res://Superglue/Sourcecode/CameraRig.gd:4 - Parse Error: Expected end of statement after variable declaration, found “Annotation” instead.
ERROR: res://Superglue/Sourcecode/CameraRig.gd:5 - Parse Error: Unrecognized annotation: “@export_hint_string”.

Anyone with a single example of the proper syntax to inject editor hints?
Ty.

Doc comments start with two hashtags, though it doesn’t always work, seems to take reloading the project some times.

## A doc comment for target_path property
@export var target_path: NodePath
3 Likes

Thanks gertkeno, that reloading did the trick.

Appreciated.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.