Hello everyone,
My question is probably really easy to solve but I can’t seem to find it…
- I have a list with GameObjects
- Through inspector I add weapons to the list
- In the Start() method i set them all on false
Here is my error: I doesn’t set them to false… They are still visible when I run the game.
Code:
public GameObject[] weaponList;
void Start()
{
foreach (GameObject weapon in weaponList)
{
weapon.SetActive(false);
}
}
Pictures for better overview:
My hierarchy:
Script on Weapon Manager: