How can I fix this error

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By FireDragonGames

Error: Invalid call. Nonexistent function ‘get_interaction_text’ in base ‘StaticBody (interactable.gd)’.

Script surrounding error: if is_colliding() and collider is Interactable:
if current_collider != collider:
set_interaction_text(collider.get_interaction_text())
current_collider = collider

	if Input.is_action_just_pressed("Interact"):
		collider.Interact()
		set_interaction_text(collider.get_interaction_text())
elif current_collider:
	current_collider = null

From the error, the above script must be attached to a StaticBody, which does not have a get_interaction_text() method - just as the error states.

I’m not sure what you’re trying to do, but the error is valid.

jgodfrey | 2020-11-05 03:32