Godot Version
4.1
Question
hi, im having trouble with a line of code, this is the code:
func _ready():
(get_parent() as Ghost).direction_change.connect(on_direction_change)
(the (get_parent() as Ghost).direction_change.connect(on_direction_change)
one is the one that has an error)
the error says “Could not parse global class “Ghost” from “res://SCENES/ghost.gd”.”, i have already putted a class_name
for Ghost
theres also another error in the ghost.gd file in this line:
func scatter_position_reached():
if current_scatter_index < 3:
current_scatter_index += 1
else:
current_scatter_index = 0
navigation_area_2d.target_position = movement_targets.scatter_targets[current_scatter_index].position
(the func scatter_position_reached():
one is the one that has the error)
the error in this one says “Expected indented block after “if” block.”
im a little confused on both of these errors, how do i fix these?