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.
\$\begingroup\$
\$\endgroup\$
3
-
\$\begingroup\$ Do you know anything in advance about the shapes of the objects' colliders? \$\endgroup\$DMGregory– DMGregory ♦2019-08-07 02:57:49 +00:00Commented 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\$nyro_0– nyro_02019-08-07 08:08:56 +00:00Commented Aug 7, 2019 at 8:08
-
\$\begingroup\$ No, it's a polygon collider \$\endgroup\$Geizka Wahyu– Geizka Wahyu2019-08-10 11:32:35 +00:00Commented Aug 10, 2019 at 11:32
Add a comment
|