Any chance you have more than one object named “Sword” in the scene? GameObject.Find will return the first object named “Sword” that it finds, which may not be the one you want. It’s usually better to make a public variable named “sword” in your animation script and then drag the one you want into that slot in the inspector. Especially if you ever have two characters with swords in the scene using the same script.
No, the Sword object is the only one in existence. I’ve just restarted Unity to see if it was a bug maybe, and sure enough, the error disappeared, but the debug isn’t being shown either, so the function isn’t running.
I took a look in the animation, and the ‘function selector’ thing had changed from a drop down to this: http://prntscr.com/j4grjd
edit:
The issue seems to have fixed itself, with little to no input from me. I’m confused, but I’ll take it. Thanks for the attempted help anyway!