Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

音效

播放音效

在当前位置播放指定的音效文件。

@[play_se] {
    "path": "res://Sounds/...",
    "db": 0,
    "pan": 0
}

参数说明

  • path:音效文件路径(对应一代,如开门音效:res://Sounds/se/door_open_1.wav,参考:隐藏音频路径索引)。
  • db:音量大小,可选,默认值为 0。
  • pan:声道平衡,负数为左声道,正数为右声道,可选,默认值为 0。

在目标位置播放音效

在指定物件的位置播放音效,适合用于 3D 空间音效效果。

@[play_se_with_position] {
	"target": "物件名称", 
	"path": "res://Sounds/se/sword_swing_fail_1.wav",
	"loop": false,
	"max_dist": 800
}

参数说明

  • target:目标物件名称,音效将从该物件位置播放。
  • path:音频路径(参考:隐藏音频路径索引)。
  • loop:是否保持循环,true 为循环,否则只播放一次。
  • max_dist:声音传播距离。