Okay so I have 3 scripts that I want to communicate between each other. The Third script will enable or disable a skinned mesh renderer based on the information from scripts 1 and 2. Script 1 is my Items database. Script 2 is my Inventory. Script 3 is armor equip. Script 2 uses script 1 as an array and if the player picks up an item it’ll use the information from script 1 to add it to script 2’s inventory. If it’s a piece of armor and the character transfer it to the EquipMenu that is inside of Inventory, I want script 3 (armor equip) to turn off my human torso and turn on a piece of armor using renderer.enabled. Here’s a piece of script I got to work but it keeps giving me null reference errors.
function Update()
{
if(GameObject.Find("BARB_Male_00").GetComponent("Inventory").EquipMenu[0].Equipped == true)
Debug.Log("YAY");
renderer.enabled = false;
}
Thanks for the help!
PS The Armor script that render’s the mesh is on the piece of body. Ex Chest Equip script is on the Torso of my character. I don’t know what I have to add to remove the null reference errors.