Wanted to add my tuppence while this is still considered current.
I have found it necessary to wait a small time after player.CharacterAdded:Connect(onCharacterAdded)
fires.
I don’t actually call wait
or task.wait
, which is generally frowned upon, not that would stop me. Instead I add accessories (just my hat) which seems to impart all the delay I need. Here are my timings:
23:30:54.818 too soon to `animator:LoadAnimation(animation)`
23:30:55.114 1772336109 Enum.AccessoryType.Hat
23:30:55.428 not too soon to `animator:LoadAnimation(animation)`
So yeah, I’m effectively waiting some arbitrary time of about 0.5s, which is bad practice, but it works so why complain?
The elaborate solutions above look nice, but there is nothing specifically to wait for, in either case (both too soon and not too soon):
print(player.Character.Humanoid.Parent.Parent)
returned nil
. Which I don’t understand because:
player.Character.Humanoid.Parent.Parent == player.Character.Parent == player