I’m creating a store in-game where player can select the character and check it in 3D. I’ve created a ViewportFrame inside Screen Gui and trying to load some basic animations and unable to do so.
I did tried same script on same model in workspace and it works fine, but not in ViewportFrame.
here is the script.
wait(5)
local mainFrame = script.Parent
local viewportFrame = mainFrame.ViewportFrame
local model = viewportFrame:FindFirstChild("Burger")
local humanoid = model:FindFirstChild("Humanoid")
local idealAnimation = model:FindFirstChild("Ideal") -- This is animation
local player = humanoid:LoadAnimation(idealAnimation)
print(player)
player:Play()
-- Here I'm applying same animation on same model in Workspace
local workspaceModel = workspace.Burger
local wHumanoid = workspaceModel.Humanoid
local wPlayer = wHumanoid:LoadAnimation(idealAnimation)
wPlayer:Play()
