so first way is triggers or collision, second raycast and third player proximity…
i can imagine using an On…Enter function with a collider or trigger would be cheaper as checking a tag or so with a raycast?
but what about checking the distance between the item and the player if its less than … start a pickup dialog?
what are the pros and cons comparing the 3 methods?
the cons i find on the first two methods is 1 using triggers: the trigger are best a bit bigger as the object so you don’t have to “stand on top of them” to collect. i just find it messy having an extra sphere collider or what not as an extra component for this because i still need the mesh collider for the physics…
2 a bit the same problem because i don’t want the player to be to secure in actually having to look with a certain precision to be able to collect
so for now i seem to favour the third, only i was wondering about the cost of keeping track of the player position from the items. they go up in the hundreds if not more eventually… and each one constantly checking for the distance between itself and the player…?
i have all item in a list per level. would it be cheaper to let the player check distance against the items in the list?