After scripting in c++ (avoiding objects as much as possible) I now have no clue how I can make a character interact with another character in an object-oriented language.
More specifically, damage.
I can write a stats code, and then a modified stats code, along with a skills code, and then an enemy code. I can also make the projectile fire, and then trigger when colliding with the character.
My main concern is I don’t know how to call THAT specific character without making my code way over-complicated (i.e. 100 if/then/ statements per character). I have approximately 7 main characters, so I’m not exactly looking forward to writing way over 700 lines of code only to be faced with inevitable lag.
TL;DR
How do I make an object interact with another object by directly modifying its’ vitals without having to condition check EVERY character/ally/object/enemy in the game? I know about ridigbodies/colliders etc, but in general how would I go about effecting stat variables for one specific instance of a class?
I understand that:
Character A launching his projectile and its colliding with Character B.
Damage calculation require stats of both side. So we need to know attacker and defender.
Character B is collided one. You want to know A. Then you can access its stats. You dont need check every thing.
Put a script on projectile contains “Transform Shooter;” when Character A attacking you will Instantiate projectile. Set Instantiate object to a variable. Then access its script and set “Shooter” variable to “Shooter = transform”. in Character A transform is A object. When projectile hit. Check if collided object is a character/damageable object with if its include script. Then call Character B’s “TakeDamage(Transform Damager)” function. Sure you added characters how they taking damage. Now this function knows attacker (Damager variable) and defender (who had script). So you can calculate.
If you can expand your question i can help with coding too.
If your question is different. again expand it 
So I presume that instances of your stats objects are stored in public variables on a script attached to the GameObjects representing the characters.
So lets say a character fires a projectile - you are therefore presumably instantiating some projectile prefab that has some scripts attached to it.
var myProjectileTransform = Instantiate(projectilePrefabInATransformVariable, someWhere, atSomeRotation) as Transform;
Now lets assume that you have a script on the projectile that knows when it’s hit something - you want to add a variable to that which references your Character behaviour that owns the stats. Then set it just after the Instantiate.
myProjectileTransform.GetComponent<ScriptWithTheCharacterVariable>().character = GetComponent<ScriptWithTheStatsVariables>();
Then when the projectile hits something you are going to get a collision - this is inside the projectile script - which I suggested you add the character variable to.
void OnCollisionEnter(Collision collision)
{
var otherCharacterStats = collision.gameObject.GetComponent<ScriptWithTheStatsVariables>();
if(otherCharacterStats)
{
//If we got here then we hit a character
//So we can use the character variable on this script and compare it to the stats
//held in otherCharacterStats and maybe update the health which is also in
//otherCharacterStats
}
}