kong   喵Ta  
 
脚本编程 
大佬们可以帮我看看,这个错误怎么解决呢?
extends Node

@export var mob_scene:PackedScene
var score


func game_over():

$ScoreTimer.stop()
$MobTimer.stop()
$HUD.show_game_over()

func new_game():
get_tree().call_group("mobs", "queue_free")
score = 0
$Player.start($StartPosition.position)
$StartTimer.start()
$HUD.update_score(score)
$HUD.show_message("Get Ready")

func _on_MobTimer_timeout():

var mob = mob_scene.instantiate()

var mob_spawn_location = get_node(^"MobPath/MobSpawnLocation")
mob_spawn_location.progress = randi()

var direction = mob_spawn_location.rotation + PI / 2

mob.position = mob_spawn_location.poisition

direction += randf_range(-PI / 4,PI / 4)
mob.rotation = direction

var velocity = Vector2(randf_range(150.0,250.0),0)
mob.linear_velocity = velocity.rotated(direction)

add_child(mob)

func _on_ScoreTimer_timeout():
score += 1
$HUD.update_score(score)


func _on_StartTimer_timeout():
$MobTimer.start()
$ScoreTimer.start()

错误是:Invalid get index 'poisition' (on base: 'PathFollow2D').
   
[投稿须知]
投稿邮箱:hareqj@163.com
教程投稿:可提供B站视频BV号,会直接生成视频播放页。
游戏投稿:须原创,请提供 作品web版文件、作者、简要操控说明。
内容举报邮箱:hareqj@163.com,请告知内容编号(右上角)及违规说明。
Copyright Godot社区 Godot2D.com All Rights Reserved.
京ICP备13032831号