Why Wont :GetMarkerReachedSignal work?

I have this code below me, tracking the Marker “Test.” The print function will return a number, revealing that the marker “Test” does exist, however the :GetMarkerReachedSignal function won’t fire at all (the print, wwo). The “Test” marker is in the middle of the animation. Does anyone know why?

		Animation:GetMarkerReachedSignal("Test"):Connect(function(s)
					print('wwo')
				end)
			print(Animation:GetTimeOfKeyframe("Test"))

Are you sure that Animation is a reference to the AnimationTrack that is actually getting played? For example, if you call :LoadAnimation on the same Animation, this will return a new AnimationTrack everytime.

yup, im positive. (im using the exact same Animation Instance in both of the lines of code, which is shown above)

I really have no method of debugging this, maybe its simply a glitch? I dont know what other external factors could be effecting this as it seems simple enough.

Ohh, wait you’re using GetMarkerReachedSignal - this returns an event corresponding to a KeyframeMarker. If you want to wait for a specific Keyframe to be reached, you can use the AnimationTrack.KeyframeReached event, however this event is marked as deprecated in favor of GetMarkerReachedSignal. In other words, you’ll need to add a KeyframeMarker in an animation editor and listen for that instead of the Keyframe.

I believe there already is one, which is “Test.” (the :GetTimeOfKeyframe would error it Test didnt exist.)

GetTimeOfKeyframe returns the number of seconds until a Keyframe. GetMarkerReachedSignal returns an event which will be triggered when the provided KeyframeMarker is reached. Keyframe and KeyframeMarker are two different things.

1 Like