You need to cast your reference on Other_Body
to its concrete type (which would be hero
here). One way would be to use pattern matching:
if (Other_body is hero hero_body)
{
hero_body.Health -= 50;
}
Or you can simply use a cast:
// This is going to throw an exception if Other_body isn't of type hero.
var hero_body = (hero)Other_body;
hero_body.Health -= 50;