Bullet ball deviation

Hello everyone, i have a bullet ball (ball that uses linear velocity to travel)
The direction of the velocity is calculated

CloneBallBomb.Parent = workspace
CloneBallBomb.Position = originPos
CloneBallBomb.LinearVelocity.VectorVelocity = (originPos - objetivePos).Unit * -1 * 150

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.

Video:

Any help is apreciated

So a couple thoughts here.

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?

1 Like
  1. The pipe and the yellow and blue parts have CanCollide disabled so no.

  2. The ball direction is calculated by:
    subtracting the positions (their vectors) of the blue part and yellow part

the startPosition is the position of the blue part
image

and the objetivePosition is the position of the yellow part
image

  1. Yes the ball collides with the ground and maybe that could be the problem, i will try to reduce friction.