how to cast to enemy to get the name variable

do you mean like this?
however i get this error and i’m not sure if every enemy is covered by this