How can I fix this error: unident does not match any outer indent level?

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

This is the script…

extends Node

export (PackedScene) var Mob
var score

func _ready():
randomize()
new_game()
$HUD.update_score(score)
$HUD.show_message(“Get Ready”)
func _on_Player_hit():
pass # Replace with function body.

func game_over():
$ScoreTimer.stop()
$MobTimer.stop()
$HUD.show_game_over()

func new_game():
score = 0
$Player.start($StartPosition.position)
$StartTimer.start()

func _on_MobTimer_timeout():
# Choose a random location on Path2D.
$MobPath/MobSpawnLocation.offset = randi()
# Create a Mob instance and add it to the scene.
var mob = Mob.instance()
add_child(mob)
# Set the mob’s direction perpendicular to the path direction.
var direction = $MobPath/MobSpawnLocation.rotation + PI / 2
# Set the mob’s position to a random location.
mob.position = $MobPath/MobSpawnLocation.position
# Add some randomness to the direction.
direction += rand_range(-PI / 4, PI / 4)
mob.rotation = direction
# Set the velocity (speed & direction).
mob.linear_velocity = Vector2(rand_range(mob.min_speed, mob.max_speed), 0)
mob.linear_velocity = mob.linear_velocity.rotated(direction)

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

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

:bust_in_silhouette: Reply From: alshahriorhasan

Test it out your script

OK. THANK YOU.

David8184 | 2021-07-11 20:57

My pleasure . . . .

alshahriorhasan | 2021-07-11 20:59