nonexistent function 'start' in base 'GDScrptNativeClass'

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

Im trying to make a timer for invncibility but for some reason it doesn’t work…
here’s my code:

extends Area2D

const hitEffect = preload("res://Effects/HitEffect.tscn")

var invincible = false setget set_invincible

signal invincibility_started
signal invincibility_ended

func set_invincible(value):
	invincible = value
	if invincible == true:
onready var timer = Timer

func start_invincibility(duration):
	self.invincible = true

func _create_hitEffect():
	var effect = hitEffect.instance()
	var main = get_tree().current_scene
	effect.global_position = global_position - Vector2(0, 8)

func _on_Timer_timeout():
	self.invincible = false

func _on_Hurtbox_invincibility_started():
	monitorable = false

func _on_Hurtbox_invincibility_ended():
	monitorable = true

any help would be greatly appreciated!

:bust_in_silhouette: Reply From: WaterDev

Nvm my dumb a** figured it out lol

Glad you figured it out, but you really should outline the actual answer/fix in case it’s helpful to someone else with a similar problem in the future.

jgodfrey | 2020-09-27 14:37

No no, it was just a slight misspelling in my code lol

WaterDev | 2020-10-03 10:42