So, I want to make a sitting animation for a campfire in one of my games, they somehow don’t work in game. They work perfectly fine in studio, and it’s annoying me.
In Studio:
In game:
I’ve tried changing the animations setting from Core to idle to movement and whatsoever, and nothing works!
I use a script created by Endorsed model
-- 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)
Please help me solve this issue. It would be greatly appreciated! Thank you!