-
Notifications
You must be signed in to change notification settings - Fork 83
Open
Description
The event parameters aren't applied when play_one_shot() is called on the EventEmitter, it always used the default values.
Example:
# This doesn't apply the parameters
set_parameter("impact", 500)
set_parameter("surface_type", "metal")
play_one_shot()
# This works like expected
var instance = FmodServer.create_event_instance_with_guid("{69afe3db-6810-4d93-83be-efdd81e23827}")
instance.set_parameter_by_name("impact", 500)
instance.set_parameter_by_name_with_label("surface_type", "metal", true)
instance.start()
instance.release()
Seems like apply_parameters() always applies the parameters to "_event" not to the variable "event" field used inside the _play method, so new created one shot events don't get the proper parameters.
template<class Derived, class NodeType>
template<bool is_one_shot>
void FmodEventEmitter<Derived, NodeType>::_play(bool should_start_event) {
Ref<FmodEvent> event;
if (is_one_shot) {
event = _create_event();
} else {
if (_event.is_null() || !_event->is_valid()) { _load_event(); }
event = _event;
}
if (event.is_null()) {
// No event loaded, nothing to do here
return;
}
event->set_volume(_volume);
apply_parameters();
set_space_attribute(event);
if (!_programmer_callback_sound_key.is_empty()) {
event->set_programmer_callback(_programmer_callback_sound_key);
}
if (!should_start_event && event->get_playback_state() != FMOD_STUDIO_PLAYBACK_STOPPED) {
return;
}
event->start();
event->release();
}
Metadata
Metadata
Assignees
Labels
No labels