GameObject bullets = GameObject.FindGameObjectsWithTag(“bullet”);
if (transform.position.x == bullets*.transform.position.x){*
_ transform.Translate(Vector3.right * Speed * Time.deltaTime);_
-
i++;*
-
}*
i want to be able to check the npc’s position relative to the bullets’ position and since there’s multiple bullets I need to index them but I don’t know why this code isnt working. Or if theres a better way to do this without having to put all the bullets into the array. the code is way more complex than this and theres a lot more conditions but I just need to know how to index through all the bullets correctly.