originPos is the position of the Blue Cylinder
objetivePos is the position of the Orange Cylinder
Note:
objetivePos is only a reference of the direction of tha ball and its not actually where the ball is supposed to reach.
PROBLEM:
The thing is that sometimes, the ball deviats from its direction a little bit which produces imprecise bullets and that cannot happen at all costs.
My first thought seems unlikely, but is it possible the ball is colliding with something in that pipe?
My second thought is that there might be a slight deviation between the calculation for the pipe, and the calculation for the ball direction. Can you calculate the ball direction from the pipe? (Or are you doing that? No idea what objectivePos is)
Is the ball colliding with the ground causing the physics system and friction to mess with it?