Humanoid is not loaded when Character is loaded?

@Controller()
export class PlayerAnimation implements OnStart {
onStart() {
print("Start");
const localPlayer = Players.LocalPlayer;
const animation = createPreviewAnimation(carryKeyframeSequence);

if (!animation) {
warn("Animation was not created");
return;
}

const character = localPlayer.Character || localPlayer.CharacterAdded.Wait()[0];
const humanoid = character.FindFirstChildOfClass("Humanoid");
if (!humanoid) {
warn("Humanoid was not found");
return;
}
//...
}
}
@Controller()
export class PlayerAnimation implements OnStart {
onStart() {
print("Start");
const localPlayer = Players.LocalPlayer;
const animation = createPreviewAnimation(carryKeyframeSequence);

if (!animation) {
warn("Animation was not created");
return;
}

const character = localPlayer.Character || localPlayer.CharacterAdded.Wait()[0];
const humanoid = character.FindFirstChildOfClass("Humanoid");
if (!humanoid) {
warn("Humanoid was not found");
return;
}
//...
}
}
2 Replies
PoppingPopper
PoppingPopperOP3y ago
I'm getting my "Humanoid was not found" warning, and I don't know why? I believe I am waiting for the character to load properly.
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View

Did you find this page helpful?