Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | Beamer159 | |
Old Version | Published before Godot 3 was released. |
I made a very simple project with a base node and child SamplePlayer node. I added a sample to the sample library and wrote the code below:
extends Node2D
func _ready():
set_process_input(true)
func _input(event):
if event.type == InputEvent.MOUSE_BUTTON \
and event.button_index == BUTTON_LEFT \
and event.pressed:
get_node("SamplePlayer").play("sample")
My hope was that there would be no delay between clicking the mouse and hearing the sample. However, there is about 0.1 seconds of delay between the mouse click and the sample being heard. Is there a way to eliminate this delay, or reduce it so it is not noticeable?
I’m VERY new to all of this but I’ve seen mention of pre loading scenes and resources in other threads. Is there some way you can perhaps pre load the sample which may speed up the reaction time?
Robster | 2016-09-21 00:15
AFAIK the audio engine will be rewritten in 3.0
timoschwarzer | 2016-09-29 17:09