I want to pass more than just a string to KeyframeMarker values

As a Roblox developer, it is currently too hard to create a system dependent on animations where I require multiple values to be passed as markers only allow one string argument to be passed.

If Roblox is able to address this issue, it would improve my development experience because it would better allow me and my team to take advantage of markers and unlock their potential as markers are a great tool for triggering actions to occur alongside animations.


Current use case

My current use case is allowing my sound designer to comfortably configure properties for sounds by a marker’s value fields alone. Currently they need to edit game code to play the sounds at specific moments as well as configure the properties of the sound through a line of code I give them that they drop in where desired (and for me, this is not desired in most cases).

What I would like to be able to do is not require them to edit any game code at all. I could make a generic effects handler that will read information off the keyframe marker, configure the sound and then play it, while all the sound designer would need to do to both add and test sounds without worrying about breaking game code (which has happened before) is configure fields in a keyframe marker.

Sound designer: Adds keyframe marker → Adds fields they want that I support (sound id, volume, delay before playing, time position, time to last, so on) to marker → Done
Programmer (me): Create generic module → Use GetMarkerReachedSignal → Collect key-value pairs in event → Load in sound, configure properties accordingly then play to specifications

Why current methods do not work

The only reasonable way I can get this done is by instructing the sound designer to write sound data in JSON format but that’s not entirely intuitive. Animations do not support getting all markers in an animation nor their timestamps so I can’t make a best guess as to which markers are related. Adding multiple markers and just providing different values would be chaos to figure out which ones are related (e.g. one provides volume, one provides SoundId - but how do I figure out if they’re belonging to the same instruction or not? What if I want more than one sound at the time?).

Workarounds & possible solutions for Roblox

I could write a plugin that simulates my desired use case by making a list of fields the sound designer needs to fill in and then having a button spit out a JSON format that the sound designer copies and pastes to the marker’s value. This is the only reasonable non-first party solution and I have no aversion to using it if this feature request seems out of scope.

I feel it would be better for Roblox to support this natively so I can more intuitively design my system. Instead of having to write my own tooling or workarounds to support this feature, it could become first party and work for many teams on Roblox. Sound designers using animation-dependent timing could just make specifications for how a sound should be ran and then programmers just need to read off that data. The ideal is being able to receive multiple name-value pairs, be it through an API or collating the fields given to markers in a dictionary.

3 Likes