Topic was automatically imported from the old Question2Answer platform.
Asked By
Çağdaş Çağlak
Hello,
I have explosion particle node and 2 objects. When one of them hits other one, particle will emitting. There is a no problem while emitting, but when first emit was being, there is a lag after that every thing normal. My code snippet is below. I need to resuse particles but this problem about initialization phase.
onready var explosed = preload("res://Scenes/Explosed.tscn")
var explode = explosed.instance()
explode.position = position
explode.emitting = true
explode.one_shot = true
add_child(explode)
Is something common by the way, is just hard to notice when you are not making the game…
On release and on certain devices it may not be noticeable, but is particularly bad on web and mobile.
Suggested solutions are to create and keep materials on the scene before starting the game, out of view but keep them around.
CPU particles on 3.1 will help on these cases, but there is no better solution for spatial materials and complex shaders.
Caching may be added with vulkan support later.
I tried this method and it will work but I re-design my particle nodes, now everything works fine.