Setting the priority to action isn't stopping my animation from blending

I’m trying to play a dribbling animation when my player touches a ball. It works fine, but my dribbling animation is mixing with the default walking animation. I already tried setting the priority of my animation to action, but it did nothing.

local Players = game:GetService("Players")
local Wspace = game.Workspace
local Rstorge = game.ReplicatedStorage

local character = script.Parent 
local humanoid = character:FindFirstChild("Humanoid")

local dribbling = Rstorge.dribbling
local dribbleTrack = humanoid:LoadAnimation(dribbling)
print("dribbling anim loaded")
dribbleTrack.Looped = true
dribbleTrack:AdjustWeight()

local player = Players:GetPlayerFromCharacter(character)
local hitbox = game.ReplicatedStorage.hitbox:Clone()

local balls = Wspace.balls

--attach the hitbox to urself--
hitbox.Parent = character
local weld = Instance.new("Weld")
weld.Parent = character
weld.Part0 = hitbox
weld.Part1 = character.HumanoidRootPart
hitbox.Position = character.HumanoidRootPart.Position
weld.C0 = CFrame.new(0,2.5,2.5)	

local mouse = player:GetMouse()
mouse.Button1Down:Connect(function()
	print("click")
	local objects = Wspace:GetPartsInPart(hitbox) --when the player clicks, this is all the objects the hitbox is touching--
	for i=1, #objects do
		if objects[i].parent == balls then
			print("you have the ball")
			local ball = objects[i]
			ball.Parent = character
			local connection = Instance.new("Motor6D")
			connection.Parent = ball
			connection.Part0 = character.HumanoidRootPart
			connection.Part1 = ball
			dribbleTrack:Play()
			break
		end
	end
end)

The script connects the ball and plays the animation and everything, but the animation blends in with the normal walk and idle animation

Try changing the animation weight, checking the AnimationPriority, stuff like that. If you can’t figure it out I’d recommend sending a bideo

do i have to set the run and walk animations weight to 0 or something so they dont blend?
My animation is set to action so it should work. Thats what got me confused

OH SHOOT I FORGOT? check your animation’s weight compared to the run and walk weight, and yeah, try the run and walk weight to 0 thing.

I tried setting the weight but nothing seemed to happen. Check out this video
robloxapp-20240714-1449320.wmv (1.8 MB)
The animation works fine when I’m not moving, but when I start to move, my guy starts doing the griddy or something. How do I get the animation to play without doing all that extra stuff?

doing the griddy LOL

you said your anim is set to action. which action, action4? cuz im pretty sure you need to try action4

Just tried that. It didn’t change anything, but I tried deleting the animate script from my character in game, and that did the job. The only problem is that that script needs to work while the character doesn’t have the ball. Im gonna try momentarily disabling it and seeing if that will work.

1 Like

Disabling the script doesn’t work, but even if it does, I know somethings gotta be off because shouldn’t my animation just be able to play if the priority is higher than Roblox’s animations? Is there something wrong with the script above? I really need this animation to work and I’m stuck right now.

Also, Im sorta lost with this animate script. I read there was some sort of update about animation blending but the last time i tried to use studio was years ago so im kind of lost right now. I tried to change the animations weight in this part (line 44-49). It used to be 10 or something but i changed it to 0 and nothing changed:

walk = 	{ 	
				{ id = "http://www.roblox.com/asset/?id=507777826", weight = 0 } 
			}, 
	run = 	{
				{ id = "http://www.roblox.com/asset/?id=507767714", weight = 0 } 
			}, 
1 Like

alright this is weird. I tried playing the animation I made in a new baseplate and now it doesn’t play at all. What could I be doing wrong? The animation is mine and i set it up the exact same way as before.

robloxapp-20240715-2116538.wmv (1.0 MB)

This is the code i used. (in startercharacter)

local Players = game:GetService("Players")
local Wspace = game.Workspace
local Rstorge = game.ReplicatedStorage

local character = script.Parent 
local humanoid = character:FindFirstChild("Humanoid")

local dribbling = Rstorge.runningdribble
local dribbleTrack = humanoid:LoadAnimation(dribbling)
print("dribbling anim loaded")
dribbleTrack.Looped = true
dribbleTrack.Priority = Enum.AnimationPriority.Action3

local ball = Rstorge.Ball:Clone()
ball.Parent = character
local connection = Instance.new("Motor6D")
connection.Parent = ball
connection.Part0 = character.HumanoidRootPart
connection.Part1 = ball
dribbleTrack:Play()
print("anim playing")
1 Like

if the animation isnt playing make sure it (and the game you made it in) are published

regarding everything else. What happens if you completely override the default walking animation?

I did try replacing the walking animation with mine and it played, but that won’t work for me because I only want them doing that animation when they have the ball

then can you write a script that replaces the animation only when they have a ball?

Im not a scripter but wouldn’t something like
If hasBall == true
then walkAnimation = animationID
else walkAnimation = Defualt

Im not sure if thats gonna work because when I overrided the walk animation it also blended with the jump and idle animations.

but you have custom jump animations when a player has a ball yeah? Like they grab it n shoot it or something. and I would assume the idle is just dribbling yeah?

Also I noticed when you mentioned how you were changing the animation priority did u do it from the animation menu?

Screenshot 2024-07-06 133850

1 Like

I did it from both, the script and the menu, but it still didn’t work.

I heard someone say that I may have to put all the bodyparts in my animation in a keyframe, even if they don’t move, so they don’t get influenced by default animations, so im gonna try that.

1 Like

just figured it out! It was just that I didn’t have a keyframe in each body part, so the default animations still moved those parts regardless of if the priority was higher.

robloxapp-20240716-1236054.wmv (1.8 MB)

1 Like

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