Setting RTPC Values - alessandrofama/wwise-godot-integration GitHub Wiki
Consider this simple scene tree:
We want to set the RTPC value of a game sync named Volume
(mapped to the Voice volume of the respective playlist container) to a random value between 0 and 100 every frame.
To do this, we attach a script to the root node and call Wwise.set_rtpc_value
in the _process callback
:
func _process(delta):
Wwise.set_rtpc_value("Volume", randf_range(0, 100), $MusicEvent)
The first parameter is name
of the game sync, the second the value
and third the associated game_object
.
For AkEvent
nodes, you can pass directly the node as this parameter.
If you are manually posting events in GDScript, you can set RTPC values by passing the registered game_object
as the third parameter to Wwise.set_rtpc_value
. In this example, the node in which the script resides is registered as the game_object
:
func _ready():
Wwise.register_game_obj(self, "Music GameObject")
Wwise.post_event("Music", self)
func _process(delta):
Wwise.set_rtpc_value("Volume", randf_range(0, 100), self)
If you need to set a global RTPC value simply pass null
as the third game_object
parameter to Wwise.set_rtpc_value
:
func _process(delta):
Wwise.set_rtpc_value("Volume", randf_range(0, 100), null)