Topic was automatically imported from the old Question2Answer platform.
Asked By
msherif
Even though I have selected the Mob scene in the Script Variables under the Inspector tab, I keep getting the error mentioned in the title.
extends Node
export (PackedScene) var mob
var score
func _ready():
randomize()
# Called every frame. 'delta' is the elapsed time since the previous frame.
#func _process(delta):
# pass
func game_over():
$ScoreTimer.stop()
$MobTimer.stop()
func new_game():
score = 0
$Player.start($StartPosition.position)
$StartTimer.start()
func _on_MobTimer_timeout():
$MobPath/MobSpawnLocation.offset = randi()
var mob = Mob.instance() #This is the line that causes the error
func _on_ScoreTimer_timeout():
score += 1
func _on_StartTimer_timeout():
$MobTimer.start()
$ScoreTimer.start()
Would appreciate any tips to help solve this issue.