Godot Version
4.6
Question
I am running into a weird issue in my latest project.
As I export to web for itch, I use the compatibility renderer. In my previous projects, I preloaded particles at the start screen (out of sight) and circumvented the first shot lag.
However, it does not seem to work in my current project.
The structure is
Start Screen → Shop → Game
Each is a top level scene.
I have 4 particle systems, I have even created and saved a process material for each to see if the issue was that it was not in a tres file, then ran them all (even on screen, to verify they ran) in my start menu scene.
for system in $ParticlesLoad.get_children():
system.restart()
They are all one shot, like some of the previous projects.
Except, the lag still occurs in game.
I use this to load a “shop scene” between the menu and game
Tools.fadein(tree.get_first_node_in_group('fade'), 1).finished.connect(func(): tree.change_scene_to_packed(game_scene))
Then from the shop I use this for the game scene. In ready:
***`ResourceLoader`***`.`***`load_threaded_request`***`("res://scenes/game.tscn")`
Then process. Can start is set to true after I push a button
func _process(_delta) -> void:
if can_start && ResourceLoader.load_threaded_get_status("res://scenes/game.tscn") == ResourceLoader.THREAD_LOAD_LOADED:
set_process(false)
var scene = ResourceLoader.load_threaded_get("res://scenes/game.tscn")
var tree = get_tree()
Tools.fadein(tree.get_first_node_in_group('fade'), 1).finished.connect(func(): tree.change_scene_to_packed(scene))
Am I doing something wrong? I figured I’d try to preload the scene to avoid a pause when switching, not sure if that interferes
Thanks in advance