Animation time position doesn't update? (Animation not replicating to server: ran from serverScript)

So what I’m trying to do is get the time position from a animation to get the finished frame and beginning frame of the animation and make sure the animation doesn’t get past those points for a catapult,
(if you move the catapult too far up it’ll go back to the starting spot instead of stopping to run the animation) Ideas I had to fix this issue was checking the brick position on the server (but the animation doesn’t replicate to server and using TimePosition but timepos is always 0 in this context, so I’m stumped right now on how to do this thought also of tracking this with a attribute value but thats a last resort)

this is my code

        --Animation controller is being played only once in this script so the animation doesn't glitch (restart)
        --this code runs everytime someone presses a key to move the catapult up and down
		if direction == "up" then
			AnimTrack = findAnimationController:LoadAnimation(findReloadAnim)
			
			AnimTrack:AdjustSpeed(0.15)
			task.wait(AnimTrack.Length * 0.14)
			AnimTrack:AdjustSpeed(0)
			print(AnimTrack.TimePosition) -- stays 0
		elseif direction == "down" then
			AnimTrack = findAnimationController:LoadAnimation(findReloadAnim)

			AnimTrack:AdjustSpeed(-0.15)
			task.wait(AnimTrack.Length * 0.14)
			AnimTrack:AdjustSpeed(0)
	        print(AnimTrack.TimePosition) -- stays 0
		end
1 Like

UPDATE: I know why the time position doesn’t update and its because the animation isn’t replicating to the server, so my new issue is why its not replicating to the server

If you play the animation on the client it will not replicate to the server.

I know I’m not playing it on the client (Check the title)

Then i’m not quite sure, the only thing i can suggest is maybe to not use an animation and instead maybe use AlignPosition and AlignOrientation or another alternative? After watching your video it seems better for your case. Sorry that i can’t help you.

My original thing was to use tweenservice and tween the catapult arm and body separately, but it has issues where they sometimes misalign, not sure about using constraints though since I find them buggy