Advertisement
XeroXipher2022

GoDot Loading Screen

Dec 3rd, 2024
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. extends Control
  2.  
  3. @onready var loading_bar: ProgressBar = %LoadingBar
  4.  
  5.  
  6. func _LoadingScreen():
  7.     while(loading_bar.value < 100): //This is where my error is (loading_bar.value is null) but it should be 0.
  8.         loading_bar.value += 1
  9.         await get_tree().create_timer(0.3).timout;
  10.     print("Game Loaded")
  11.    
  12.    
  13.  
  14.  
  15. func _enter_tree() -> void:
  16.     _LoadingScreen()
  17.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement