I'm rigging the clock to display the number textures on the scoreboard and basket models
var score_clock_texture :=
{
var 1 = basketball_goal_gameclock = preload("res://Textures/Basketball/Basketball Goal/game_clock_number_1.png") : scoreboard = preload("res://Textures/Basketball/Scoreboard/digit_1.png"),
var 2 = basketball_goal_gameclock = preload("res://Textures/Basketball/Basketball Goal/game_clock_number_2.png") : scoreboard = preload("res://Textures/Basketball/Scoreboard/digit_2.png"),
var 3 = basketball_goal_gameclock = preload("res://Textures/Basketball/Basketball Goal/game_clock_number_3.png") : scoreboard = preload("res://Textures/Basketball/Scoreboard/digit_3.png"),
var 4 = basketball_goal_gameclock = preload("res://Textures/Basketball/Basketball Goal/game_clock_number_4.png") : scoreboard = preload("res://Textures/Basketball/Scoreboard/digit_4.png"),
var 5 = basketball_goal_gameclock = preload("res://Textures/Basketball/Basketball Goal/game_clock_number_5.png") : scoreboard = preload("res://Textures/Basketball/Scoreboard/digit_5.png"),
var 6 = basketball_goal_gameclock = preload("res://Textures/Basketball/Basketball Goal/game_clock_number_6.png") : scoreboard = preload("res://Textures/Basketball/Scoreboard/digit_6.png"),
var 7 = basketball_goal_gameclock = preload("res://Textures/Basketball/Basketball Goal/game_clock_number_7.png") : scoreboard = preload("res://Textures/Basketball/Scoreboard/digit_7.png"),
var 8 = basketball_goal_gameclock = preload("res://Textures/Basketball/Basketball Goal/game_clock_number_8.png") : scoreboard = preload("res://Textures/Basketball/Scoreboard/digit_8.png"),
var 9 = basketball_goal_gameclock = preload("res://Textures/Basketball/Basketball Goal/game_clock_number_9.png") : scoreboard = preload("res://Textures/Basketball/Scoreboard/digit_9.png"),
var 0 = basketball_goal_gameclock = preload("res://Textures/Basketball/Basketball Goal/game_clock_number_0.png") : scoreboard = preload("res://Textures/Basketball/Scoreboard/digit_0.png")
}
func _ready() -> void:
timer.connect("_on_Timer_timeout", label, "toggle_visibility")
game_clock = minutes = 12
shot_clock = seconds = 24
func _format_seconds(time : float, use_milliseconds : bool) -> String:
var minutes := time / 60
var seconds := fmod(time, 60)
if not use_milliseconds:
return "%02d:%02d" % [minutes, seconds]
var milliseconds := fmod(time, 1) * 100
if minutes:
$sports_arena/basketball_goal.get_mesh().get_surface_material(1).set_texture(SpatialMaterial.TEXTURE_ALBEDO, texture)
$sports_arena/basketball_goal.get_mesh().get_surface_material(2).set_texture(SpatialMaterial.TEXTURE_ALBEDO, texture)
$sports_arena/basketball_goal2.get_mesh().get_surface_material(1).set_texture(SpatialMaterial.TEXTURE_ALBEDO, texture)
$sports_arena/basketball_goal2.get_mesh().get_surface_material(2).set_texture(SpatialMaterial.TEXTURE_ALBEDO, texture)
$sports_arena/scoreboard.get_mesh().get_surface_material(8).set_texture(SpatialMaterial.TEXTURE_ALBEDO, texture)
$sports_arena/scoreboard.get_mesh().get_surface_material(9).set_texture(SpatialMaterial.TEXTURE_ALBEDO, texture)
if seconds:
$sports_arena/basketball_goal.get_mesh().get_surface_material(4).set_texture(SpatialMaterial.TEXTURE_ALBEDO, texture)
$sports_arena/basketball_goal.get_mesh().get_surface_material(5).set_texture(SpatialMaterial.TEXTURE_ALBEDO, texture)
$sports_arena/basketball_goal2.get_mesh().get_surface_material(4).set_texture(SpatialMaterial.TEXTURE_ALBEDO, texture)
$sports_arena/basketball_goal2.get_mesh().get_surface_material(5).set_texture(SpatialMaterial.TEXTURE_ALBEDO, texture)
$sports_arena/scoreboard.get_mesh().get_surface_material(10).set_texture(SpatialMaterial.TEXTURE_ALBEDO, texture)
$sports_arena/scoreboard.get_mesh().get_surface_material(11).set_texture(SpatialMaterial.TEXTURE_ALBEDO, texture)
return "%02d:%02d:%02d" % [minutes, seconds, milliseconds]
func _on_Timer_timeout() -> void:
emit_signal("counted_down", _count)
_count -= 1
if _count < 0:
stop()
pass # Replace with function body.
but I got this error on the scoreclocktexture
Parse Error: Error parsing expression, misplaced: '\n'
whats causing the error?