Hi DevForum, the title is self explanatory. I will provide a snippet of my code:
function CombatServerModule:PlayAnimation(action)
if action == "M1" then
local animation = self.Animations[(self.Weapon).. (tostring(self.Combo))]
if animation then
for i, track in pairs(self.Animations) do
track:Stop()
end
animation.Priority = Enum.AnimationPriority.Action4
animation.Looped = false
animation:Stop(0)
animation:Play()
return animation
end
end
end
local Animation : AnimationTrack = self:PlayAnimation("M1")
Animation:GetMarkerReachedSignal("hit"):Once(function()
local Detected, Results = self:Hitbox()
if Detected and Results then
self:Combat(Results)
end
end)
Let me add that the animation plays, but never reaches the âhitâ marker apparently. I tried looking around and saw some advice such as upload assets under a group, but I would like to hear anything anyone has to say about this.
So essentially upload the assets under a group and play animations from client? Itâs an NPC though, how would I play an animation from the client then get the hitmarker for it?
The game is already under my profile and so are the animations. I have the animations playing on the server the same way it plays for the character, but I did like look into things and it was recommending to do it under a group instead, but I donât know how accurate that is.
Have you tried using âKeyFrameReachedâ as an alternative since the signal doesnât fire? You can also try moving the SignalReached function within the :PlayAnimation function above the line âanimation:Play()â to ensure that the signal is established before the animation plays.