So i have exported my game to the Web, and noticed a lot of lags, currently the main thing i worry about is when i just opened the game and for example pressing shoot button, it takes some time before shoot (looks like it load something, but i don't know actually).
Example:

Generally it have a lot of freezes / lags, i would like to know how to fix it.
The lags appears only when exporting for Web.
on PC it looks ok.

[ Browser testing (.html) ]
I'm getting 28-35 fps from 60 needed on my laptop.
Also, tested on high-res screen -> 24-27 / 60 fps

[ PC testing (.exe) ]
about 55/60 fps on laptop
about 50/60 fps on high-res screen

It's not such big game, it's not even a demo, it's just an test run.

darceyo changed the title to The game lagging after exported to the Web (.HTML) .

upd. What i have noticed is when i creating the bullet (not only bullet but any node stored in var) at first time it have that lag.
but why? the hit_point it's only 3d cube, without any other node inside itself...

@onready var hit_point = preload("res://scenes/weapons/bullets/bullet_hit.tscn")

func shoot():
   var hit = hit_point.instantiate()
   var world = get_tree().get_root()
   world.add_child(hit)
   *lag here*