- Home /
Question by
Warner30 · Jun 16, 2018 at 10:16 AM ·
physics2draycastingaimingprediction
Billiard/Pool aiming issue
I'm trying to calculate what angle to hit a pool ball and predict where ball will go to.. I thought target ball should move within a normal direction.. but it moves on totally different direction
RaycastHit2D hit = Physics2D.CircleCast(cue.position, _radius, dir, 100f, ~(ignoreLayer));
if (hit.collider != null)
{
Debug.DrawRay(hit.collider.transform.position, -1f * hit.normal,
Color.green, Time.fixedDeltaTime);
}
Result
Set velocity
rb.velocity = dir * force;
Result: If i increase or decrease force strength result is different
How to find exact move direction, Thanks
Comment
Your answer
Follow this Question
Related Questions
Mouse Aim for a 2.5D game 1 Answer
RaycastHit2D.collider always null? 0 Answers
How to use Raycasting 2D to mouse click and delete objects? 1 Answer
Why is RaycastHit2d Not working 0 Answers