This question was
closed Mar 19, 2019 at 02:09 PM by
SLEIDER for the following reason:
The question is answered, right answer was accepted
Change variable independently for different objects with same script.,Change variable in different object but same script
So I have multiple objects with the same script. If I access the script and change something, the change goes for every object. How do i change only the variable of one specific object?
Comment
I solved my problem by making the objects from which I change the variable children of my object I want to change the variable in ( childObject.transform.parent = gameObject.transform; ) and then access the parent specific script ( transform.parent.GetComponent(); )