How do i find an animation within a script?

Hey there,

I’m making a basic quest tracker for my quest system. I want to make it so when enemy’s with the tag enemy and a certain animation plays, your counter goes up by one. In the script I’ve tried to add the tag + death animation, however i keep getting these errors:

CS1502: The best overloaded method match for UnityEngine.Object.FindObjectsOfType(System.Type)' has some invalid arguments CS1503: Argument #1’ cannot convert string' expression to type System.Type’

Here’s my current script for reference:

using UnityEngine;
using System.Collections;

public class Quest1 : MonoBehaviour {
	
	
	int counter = 0;
	int Maxcount = 10;
	void OnGUI(){
	
		GUI.Box( new Rect(1000,500,110,50), "Wolfs Killed" + counter + "/" + Maxcount);
		
		}
	
	void Update(){
	
		if (GameObject.FindGameObjectsWithTag("Enemy") + Animation.FindObjectsOfType("WolfDeathAnimation") == true) {
		}
		}
}

Try

if (GameObject.FindGameObjectsWithTag("Enemy") && Animation.FindObjectsOfType(typeof(WolfDeathAnimation)))

Note, to join two or more clauses in an if you should use logical AND (&&) not PLUS (+)
Note also, you don’t need to say “==true” in an if statement.

I doubt this will fully work, as you seem to be checking the entire game for existence of a type o animation, but it should at least get you started.