sorry in advance english. i'm doing scripts in unity , want achieve is: i have multiple classes (b1, b2, b3) , every 1 of them inherit class. in code have container objects, contain b classes. class , b classes have function called myfunction() , there problem: when want call function on object of class i.e. b2, when in vector class objects, when call myfunction(), there executed version a, not b2. tried solve problem in best way could, ended "if b1, ... else if b2, ..." type of solution not want. as example of ugly solution (used in immaded() ), link scripts, without every line not needed in example: http://pastebin.com/4by0rkbn thank effort in advance. as per this msdn page, need declare myfunction method virtual : the virtual keyword used modify method, property, indexer, or event declaration , allow overridden in derived class. example, method can overridden class inherits it. public class { public virtual void myfunction() ...