I have looked up the forums and there are quite some topics regarding this. But I still have some open questions which are not really clear to me.
1).first of all is it ok to check for position constantly when I want to have two game objects interact with each other in a certain location? (performance wise) for example: the more objects I check the less performance I have etc.
2).why do my instantiated gameobjects have “(clone)” behind their name when they appear in the hierarchy?
I made a screenshot to explain my actual question:
I have two objects (instantiated game objects when pressing X) that move the the left and right of the screen. I want to check if both have a certain position.
I thoght something like “positionBallA == positionBallB” → then do something.
However if I use
float distance = Vector3.Distance (obj1.transform.position, obj2.transform.position);
unity wants me to drag two objects on the right side of the screen. But then it don´t finds the “(Clone)” objects, but only stuff which is placed in the scene already.
Anyone can help me? sorry for my bad english, its just confusing.