Quantcast
Channel: Latest Questions on Unity Answers
Viewing all articles
Browse latest Browse all 171066

How do I check for collisions when I move objects based on Time.deltaTime?

$
0
0
Hi all! I'm making a Pong clone for learning purposes. I'm not using Unity's built-in Physics2D system, but I'm manually moving objects by changing their positions by a *speed* value multiplied by Time.deltaTime. I'm having problems with checking for collisions between the Ball and the Bats. Currently I'm using Raycasting, with **Physics2D.Linecast(prevPos, newPos)** method, but this ignores Ball's Circle Collider and only detects collision at Ball Sprite's center (because it casts a line between the previous position of the ball and the new position). How do I detect collision between a Circle Collider and a Box Collider 2D in a continuos way without using built-in physics? Thank you in advance! :)

Viewing all articles
Browse latest Browse all 171066

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>