This has been bugging me for a couple of days now - the new 2D physics are great (except for when objects “stick” to walls etc), but the lack of CircleCast is holding me up.
What I’m trying to do is calculate and display the trajectory of a ball - the ball can collide with objects of any shape, and I need to be able to detect these collisions and modify the trajectory to suit. I’ve used LineCast but it’s only really accurate against flat walls - what I need is to be able to cast a circle and work out the collision point and normal.
Does anyone have any suggestions on how this can be achieved? I’ve thought about firing a set of maybe 10-20 linecasts from the surface of the ball, and working out which collision point is closest - which should give a fairly accurate result - but I’m worried that might affect performance, and I’m hoping there’s something easier.