I have a script that once it is activated, does some very simple things, references 2 different game objects, references a script on each, then changes a variable, except, it works great with one and not at all with the other, it has no errors it just doesn’t change the variable
public class GameEnder : MonoBehaviour {
// Use this for initialization
void Start () {
GameObject ender = GameObject.Find("Player 2(Clone)");
GameObject darkness = GameObject.Find("Darkness2");
Player2 P2 = ender.GetComponent<Player2>();
erty erty = darkness.GetComponent<erty>();
erty.h = +0.005f;
P2.end = +1;
}
// Update is called once per frame
void Update () {
}
}
p2 is the on that doesnt work pls help