R
R
RandomProgrammer2022-01-04 13:24:33
Unity
RandomProgrammer, 2022-01-04 13:24:33

How to check that the object is completely in the trigger?

OnTriggerEnter fires even if the object is part of the trigger. Is it possible to somehow check that the object is completely included in the trigger collider (ie, all points of its colliders lie in the trigger)?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
O
oblakooblako, 2022-01-05
@RandomProgrammer

There are no standard means of unity. Alternatively, if the shape of the mesh is not very important to you, but the dimensions are important, you can take the global bounding box for each object and, when triggering each frame, check whether one box is in another.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question