You should be assigning the variables after you instantiate it. For example:
if(Input.GetKeyDown(KeyCode.Space)){
int playerLevel = 1;
GameObject bullet = (GameObject)Instantiate(bullet1, gunPosition1.position, transform.rotation);
bullet.getComponent().level = playerlevel;
}
Trending Articles
More Pages to Explore .....