I am trying to define the Animator object, however it keeps on giving a warning that says “Type ‘Instance’ could not be converted into ‘Animator’”
I am not sure if that’s the right category, if it’s not i’m sorry
local plr: Player = game.Players.LocalPlayer
local char: Model = plr.Character or plr.CharacterAdded:Wait()
local hum: Humanoid? = char:FindFirstChildWhichIsA("Humanoid")
local animator: Animator? = hum:WaitForChild("Animator")
LuaU typechecking is only avaliable for functions and in your case, it is simply not needed.
Try this instead:
local Player = game.Players.LocalPlayer
local Character = Player.Character or Player.CharacterAdded:Wait()
local Humanoid = Character:FindFirstChildWhichIsA("Humanoid")
local Animator = Humanoid:WaitForChild("Animator")
I was trying to get the functions and events of the Animator to display in the auto-complete too, instead of the functions inherited from Instance only