I am looking for a way to check if my hit result is from X class and the screenshot below works as intended, returning true if that indeed the right class.
For future reference, this does the trick.
Now I am not entirely sure why the == doesn’t work anyway, but reading your answer helped me to not wander too off path looking for a solution.