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