Hmm, very good. I had not thought of that. I used his idea, but without the mathematical formula, I just added which X he should get when he collides. However, if you increase the speed to 500, for example, the error persists, but I won't use a bullet that fast, so it might work. Thanks.
But I was thinking here, maybe this is not the best way to make elements move "in line", but I couldn't find a solution other than that.