Local Script :LoadAnimations Not reading itself Correctly?

So I’m working on a sequel to one of my games, and in this game I’m having one of the levels take place in the Fnaf 2 Location. So to get started, I’m working on the animatronic AI first. but in my first game when a player would get Jumpscared on a less powerful device like a phone, the timing for when the scare ends and when the gui “game over” Gui pops up is a few seconds off. My thoughts on why this occurs is because the animation was being played on the server and was using a remote event to activate the game over Gui. So for this game I was going to try to play scare animations locally so everything will run properly.

So why did I just tell you all this?

I started with Toy Bonnie, and everything worked fine. The problem occurred when I started on Toy Chica. When I want to play an animation locally I grab the NPCs name and finds it in this table that loaded the animations:

local Animations = {
	ToyBonnie = {
		Name = "ToyBonnie",
		Stare = mod.ToyBonnie.Humanoid.Animator:LoadAnimation(mod.ToyBonnie.Animate.Local.Stare),
		Jump = mod.ToyBonnie.Humanoid.Animator:LoadAnimation(mod.ToyBonnie.Animate.Local.Jump)
	},
	ToyChica = {
		Name = "ToyChica",
		Stare = mod.ToyChica.Humanoid.Animator:LoadAnimation(mod.ToyChica.Animate.Local.Stare),
		Jump = mod.ToyChica.Humanoid.Animator:LoadAnimation(mod.ToyChica.Animate.Local.Jump)
	}
}

Anyway the problem is, even though you can clearly see that Toy Chica and Bonnie have separate sections in the table when the game is loading Toy Chica’s animations the parts where it says mod.Toy Chica it reading it as mod.Toy Bonnie which results in Bonnie playing his animations instead. here’s a Video of the result :
(I moved Bonnie into the room for context he’s suppose to be disabled on the Show Stage.)
(also the mask and effects were turned invisible so I can see it better)

and I know its not just reading Toy Bonnies section in the table because I tried to remove him from it, this problem still occurs… :person_shrugging:

If someone know what could be wrong, Or a better way to implement jumpscares another way let me know!

1 Like