I’m not doing something right here, I’ve tried a few ways… but here is what I’m trying to do in general, this code will give anyone the basic idea
void attackTarget() {
rct.target.doDamage();
}
void doDamage() {
npch.AdjustCurrentHealth(-10);
}
Basically, I’m trying to do the damage to set target (Cube) which they all have a health-script set to them. I don’t understand how to do this correctly.
rct.target is the selected cube.
I don’t know how to call the NPCH (NPCHealthHandler) from the Transform thing, /:
Basically, what this code ammounts to is this.
RaycastTargetting.target.NPCHealthHandler.AdjustCurrentHealth(-10);