- Home /
How could i differentiate attributes using code?
I have an object with two box colliders 2D, i use "this.GetComponent()" to modify the center and size, but it always return the same box collider, how can i access the other one?
Comment
Best Answer
Answer by DoTA_KAMIKADzE · Apr 14, 2015 at 11:16 PM
Check my old answer on almost the same case >>>here<<<. The only difference is that you'll need to use Collider2D instead of CountDownTimer.
Note that you can also use public variable instead of using [SerializeField] if you want to. Also in your case third example there will only work with addition which I provided in the comment below that answer.
If something isn't clear enough - let me know in the comment section below.
Thank you very much, i've solved it with AddComponent, it was pretty easy :D