Running animation with sphere rotates character to face a direction

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.

2 Likes

Is the ball anchored? Or is it not

1 Like

Are you saying the problem is that the player is rotating in front of the ball or is that the goal you are trying to achieve

1 Like

The problem is the character rotating as soon as it touches the ball, which is when the animation is run. It’s supposed to face the same direction as it was before it touched the ball. Imagine the character running towards the ball, getting it and continuing to run the same direction. Right now its doing a 180

Yea, The ball is not anchored or welded to anything else before the character touches it.

Turns out the problem was that ball needed to be massless

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.