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?