Ok so I have several different actors that players can place in a build system, once placed, they have to hit them with a hammer to increase their health to full to complete the build. So lets take two, I have a BasicWall and a GuardTower. Each of them have a variable on them called BuildHealth thats default 0. I detect them with line trace. So if each of them had a “onhitwithhammer” function, how would I call that? Or how else would I do it? I don’t want to hard code every single buildable item. Any help?
Get hit object - cast to BasicWall class - call onhitwithhammer