Whenever I trigger a ProximityPrompt, the following error pops up in the output: "Unable to cast value to Object - Client - LocalScript:5" The LocalScript is located in StarterPlayerScripts and the following script is what is in it:
local Animation = script.AnimationOpen local Proxy = workspace.MainRoomDoor.MainRoom Proxy.Triggered:Connect(function(Player) local Anim = Player.Character:WaitForChild("Humanoid"):LoadAnimation(5915776835) Anim:Play() end)
I rarely use animations so this should help you
local Animation = script.AnimationOpen local Proxy = workspace.MainRoomDoor.MainRoom Proxy.Triggered:Connect(function(Player) local humanoid = Player.Character.Humanoid local Animator = humanoid.Animator local anim = Instance.new("Animation") anim.AnimationId = "rbxassetid://5915776835" local animationTrack = Animator:LoadAnimation(anim) animationTrack.Priority = Enum.AnimationPriority.Action animationTrack:Play() end) -----EXPLANATION----- --[[ When prompt is triggered the following function will run. A variable for the humanoid and the Animator. Creating a new instance which is an Animation. Changing the AnimationId of the Animation. Loading the animation to the Animator. Changing the priority to Action. Action is the highest priority so it will override all other animations. Then it will play the Animation. ]]
Also, what is the Animation variable in your script?