Hello,
I’m trying to make a simple animation where the ball is just in front of player, but as soon as it runs, the player rotates like this:
ServerScript that handles the touch aswell:
local function PositionAndWeldBall(Player)
if Player and Player.Character and Player.Character:FindFirstChild('HumanoidRootPart') then
local Character = Player.Character
Ball.Parent = Character
Ball:SetNetworkOwner(Player)
Player.Character.HumanoidRootPart.BallJoint.Part1 = Ball
end
end
Client Module that handles the animation
function ClientModule.ChangeAnimation(Player, Humanoid, CurrentAnimation, NextAnimation)
local AnimationTracks = Humanoid:GetPlayingAnimationTracks()
for indexAnimationTrack, AnimationTrack in pairs(AnimationTracks) do
local AnimationTrackTimePosition = AnimationTrack.TimePosition
if CurrentAnimation ~= nil then
AnimationTrack:Stop(0.3)
end
NextAnimation:Play(0.3)
NextAnimation.TimePosition = AnimationTrackTimePosition
end
end
I’ve been trying to figure it out for the last hour but I can’t seem to find a solution.