void Start()
{
waypoints = GameObject.FindGameObjectsWithTag(“ClonedObject”);
robots = GameObject.FindGameObjectsWithTag(“Robots”);
AddColliderToWaypoints();
originalPosition = robots[0].transform.position;
reverseOriginalPosition = robots[1].transform.position;
}
And the AddColliderToWaypoints
void AddColliderToWaypoints()
{
foreach (GameObject go in waypoints)
{
SphereCollider sc = go.AddComponent<SphereCollider>() as SphereCollider;
sc.isTrigger = true;
}
}
Then i put a break point in the Start function once on the line:
AddColliderToWaypoints();
And then i’m using the mouse to look on the waypoints array and look into the first gameobject. It should be without a collider yet but how do i know it when looking on the gameobject in the array ?
And then i put a break point on the next line after the AddColliderToWaypoints(); to see if it’s added the colliders and again i’m looking on the first waypoints array gameobject item but i don’t see something else or new that added to it.
what am i missing ? Or what/where should i looking for in the gameobject properties after added a collider to it ?