Viewmodel Error: Index nil with IsPlaying

Hello, I have this viewmodel handler script which has some animations stored in the tool in a folder called Animations. It has first person animations and third person animations for people not in the player view. But I keep getting a error saying (attempt to index nil with ‘IsPlaying’)

section giving me the error:

if allToolAnimations[equippedTool.Name].FIRST_PERSON.AIM.IsPlaying then
	goalSprayRecoil = goalSprayRecoil / (toolConfig.BulletInaccuracy / toolConfig.ADSInaccuracy)
end

The (IsPlaying) giving me the 242 error, once again (attempt to index with ‘IsPlaying’)

Any help would help me to figure this out.

Possible causes could be:

  • There is no FIRST_PERSON.AIM animation inside the allToolAnimations table (or is it a folder?)
  • In case it’s a folder, most likely you are checking the IsPlaying property of an animation instance. Only animation tracks have this property
  • If it’s a table, make sure that FIRST_PERSON.AIM is an animation track and it exists in the table.

There is too little information, so I can’t provide you with more help.

1 Like

It was due to

  • There is no FIRST_PERSON.AIM animation inside the allToolAnimations table (or is it a folder?)

I stupidly forgot to place AIM into first person, thanks for the help though.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.