I'd like to seek advice on a scheme of lowering priority of a game object during playback which I'd like to use in my game.
The idea is, I think it would be great for long-tailed sounds (weapon shots, explosions) to change their priority while their tail (volume) is gradually decreasing. But with the condition that priority offset at distance for these objects is also working.
Since there is such a probability like “set game parameter” in event actions and the possibility to change priority of the sound with RTPC, I have constructed the next scheme:
first – RTPC game parameter to change priority of a sound
and second – an event with the next three consecutive actions:
1 - reset game parameter (to restore priority of a game object after a previous “set game parameter” action)
2 - play shot sound (with slight action delay, e.g., 0.01 sec)
3 - set priority parameter (with fade in time to lower absolute value and also with action delay, slightly bigger than previous, e.g., 0.1 sec)
And my question is, is this scheme is a correct solution for my idea or maybe I have a mistake somewhere? I have tested it in Soundcaster and everything worked correctly, but who knows, maybe there are some pitfalls.
I guess I can also use a side-chain function with RTPC driven by weapon shot peak meter for more accurate values, but the main question is the cooperation of reset and set game parameter actions with distance offset and, the reasonableness of the whole scheme.