[FIXED] Sitting Animation not working

So, I want to add a Sitting Animation to a game, where a Player can sit on a tank. And so far, the script for the animation has so far worked for every game except the one I’m working on. A Problem also is, that the animation I’m using for the seat isn’t working in other games aswell. And I have tried everything I could to fix it.
The Animation in the Animations maker:
robloxapp-20200517-2021409.wmv (364.8 KB)

The Animation when being tested:
robloxapp-20200517-2021228.wmv (739.7 KB)

I use a public script made by Endorsed Model, and as I have previously said, it worked in every one of my games so far apart from the one I’m working on and I have found no way of fixing it.

-- Created by EndorsedModel --

---------- VARIABLES ----------

local seat = script.Parent
local sleepingR15 = seat.SleepingR15
local sleepingR6 = seat.SleepingR6
local sleepAnim

---------- CONNECTIONS ----------

seat.Changed:Connect(function(property) -- if a property in the seat changes
	
	if property ~= "Occupant" then return end -- if that property is not "occupant" then we'll ignore the change and stop the function
	
	local occupant = seat.Occupant
	
	if occupant then -- if we do have an occupant then do the stuff below
		local character = occupant.Parent
		local humanoid = character.Humanoid
		local player = game.Players:GetPlayerFromCharacter(character)
		if player and humanoid.RigType == Enum.HumanoidRigType.R15 then -- checks if we're using R15
			sleepAnim = humanoid:LoadAnimation(sleepingR15)
			sleepAnim:Play()
		elseif player then -- this is for if we're using R6
			sleepAnim = humanoid:LoadAnimation(sleepingR6)
			sleepAnim:Play()
		end
	elseif sleepAnim then -- if we don't have an occupant but the property changed that means someone just got up
		sleepAnim:Stop() -- stop the sleeping animation so the player who got up isn't stuck in a sleeping animation
	end
end)

I need a solution for this problem which I haven’t been able to find. It would be helpful if you could help me fix the problem.
Thank you.

Did you make sure that the animation priority is higher than that of the core animations?

image

Core is in line with the default character animations, which can get a little weird (mixed up animations). Set your priority to idle, movement, or action.

5 Likes