-
What do you want to achieve? So basically I want it so when you enter a seat, with your normal sit animation, and after 10 seconds pass, your sitting animation inside your Animate script (the one that is inside the Character, not the script itself, the animations that are parented to it.) would change while you’re still sitting on the seat.
-
What is the issue? The animation does in fact change, but it only works if I stop sitting and sit again.
-
What solutions have you tried so far? I’ve pretty much tried looking all over the web trying to find any kind of solution that fits my needs. But I can’t seem to find anything.
The Local Script where I’m trying to achieve this.
--This Local Script is inside the StarterCharacterScripts
local change animation = game.ReplicatedStorage.ChangeAnimationEvents
local player = game:GetService("Players").LocalPlayer
changeanimation.Sit.OnClientEvent:Connect(function(id)
player.Character.Animate.sit.SitAnim.AnimationId = "rbxassetid://"..id..""
local Tracks = player.Character.Humanoid.Animator:GetPlayingAnimationTracks()
for i, track in pairs(Tracks) do --One of my poor attempts to try and refresh the animation while still being seated
print(track)
track :Stop()
track :Play()
end
end)
Edit: I should probably give more context on how the whole function works. So I have it so that when you sit in the chair, it activates a ticking timer in a script inside the character. Once this timer reaches a certain amount of time, it will fire a bindableevent to change the player’s sit animation. And the local script above is the said localscript that is activated on the clientevent.