Animation module not playing animation

Hello scripters,
I’ve created an animation module for easy animation management. Issue is my animation is simply not showing up.

	local Animite = require(ReplicatedStorage.Modules.Utilities.AnimationHandler)
	local viewModelAnimator = Animite.new(viewModelReplica.AnimationController)
	
	local animation = ReplicatedStorage.Animations[toolModel.Name].Hold
	local track = viewModelAnimator:LoadAnimation(animation, Enum.AnimationPriority.Action4)
	
	print(viewModelReplica.AnimationController.Animator:GetPlayingAnimationTracks())

local script ^^^

animation handler

local Handler = {}
Handler.__index = Handler

function Handler.new(animator)
	local self = {}
	self.tracks = {}
	
	if not animator:IsA("Animator") then
		self.animator = animator:WaitForChild("Animator")
	else
		self.animator = animator
	end
	
	setmetatable(self, Handler)
	return self
end

function Handler:LoadAnimation(animation, priority)
	assert(animation ~= nil, "Missing argument #1")
	
	local track: AnimationTrack = self.tracks[animation.Name]
	
	if not track then
		track = self.animator:LoadAnimation(animation)
		print(self.animator)
		self.tracks[animation.Name] = track
		track:Play()
	end
	
	if priority then
		print(priority)
		track.Priority = priority
	end

	return track
end


return Handler

image

ive been stumped for days, PLEASE help.

1 Like

Making a module for an animation in this case would be considered overkill.

Consider just making and playing the animation on the script since you have more options to tinker with.

1 Like

The issue I’m having is I’m trying to stop another animation on the server which I’m struggling to access.

if you are animating a player’s character then it’ll be replicated to the server and it could be stopped from there