Default Animations on New Character Doesn't Work?

Hello, DevForum!

Recently, for my class based fighting game, I was creating a module to load each class onto the given player. I figured out how to replace the players character & attach the camera back onto it, but my only problem is no matter what, the default animations aren’t working.

local newCharacter = ServerStorage:WaitForChild("ClassModels")[foundClassModule.ClassData.Character]:Clone()

newCharacter.Name = player.Name
newCharacter.Parent = workspace
newCharacter:SetPrimaryPartCFrame(player.Character.PrimaryPart.CFrame)

player.Character = newCharacter

This works, but this ends up happening:

The delay is intentional, just using a wait(5) on the requiring script to debug the module

The character spawns with the Animator in the humanoid & the Animator script, but it just doesn’t load on for some reason…

If anyone knows a better system to replace a character rather than doing this which does work with animations, or knows how to fix this, that’d be greatly appreciated!

Alright, so I partially fixed the system by changing the LocalScript Animator to a Server Sided one, but now I get this weird delay (Most likely due to it being ServerSided):

Does this still happen when you run it on the ROBLOX app?

EDIT: Try also looking at the developer console. It shows you stats on lag. What are the values?

1 Like

Yep, same issue (same if I use server [the lag] and same if I use client [it doesn’t load])

Do you have any other ideas on why this may not work?

I’ve ran into this problem before. The likely fix to it is simply disabling/reenabling the animation script.
For example, here, newshell is the player’s character and the animatescript is what I named the script holding all default character animations.
image

Edit - change your server script back to a local script within the character (as it is on default)

2 Likes

What…? Uhhhhhhh, hmmmmm. alright?

Hey! It seems like it’s working, I had to add a delay between the disabling & enabling but other than that it works :slight_smile:

1 Like

That’s great! Glad to help you out :slightly_smiling_face:

1 Like

Nope, I can confirm it works:

Weird camera bug is cause I set wait to 1 second, I will adjust this in the future but yeah.