0
\$\begingroup\$

I have to 2 objects with Collider2D. Both objects are moving, in the very next frame they will either overlap each other or not. How to predict if they would collide on the next frame? I'm thinking of instantiating a temporary object then use collider.Overlap(). But maybe there are better ways to do this.

\$\endgroup\$
3
  • \$\begingroup\$ Do you know anything in advance about the shapes of the objects' colliders? \$\endgroup\$ Commented Aug 7, 2019 at 2:57
  • \$\begingroup\$ Adding to the comment of @DMGregory if you collider is circular, for example, you could just extrapolate the current motion and compare the extrapolated collider center points to the radii \$\endgroup\$ Commented Aug 7, 2019 at 8:08
  • \$\begingroup\$ No, it's a polygon collider \$\endgroup\$ Commented Aug 10, 2019 at 11:32

0

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.