I'm making a game, if player touches bonus block(BonusBlock.class), it should call a method for spawning random bonus from the touching object. I already have this method in the BonusBlock class. That's my code:
how can I get and call any method from the touching object?
if(isTouching(BonusBlock.class)){
//calling method from the touching block
}
