P
P
PurgaBot2021-10-06 15:55:03
Unity
PurgaBot, 2021-10-06 15:55:03

How to get all objects falling on the trigger area in a 2D game?

I need to get an array of all objects passed in the trigger zone and then check if 200 objects passed through the trigger. If there is another way with the mechanics of counting and comparing objects, then tell me. The game is made in 2D.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
G
GavriKos, 2021-10-06
@GavriKos

The mechanics of the account must be implemented by yourself. the blessing becomes it elementary on List or Dictionary. And even on a regular inte if uniqueness is not needed

M
mustGamedev, 2021-10-09
@mustGamedev

If other touched the 2d trigger then:
We put other in List<> as gameObject
It seems that the implementation just wrote

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question