# Collision simulation canceling after the part has allready moved

1. What do you want to achieve? For my golfballs collisions to not be canceled.

2. What is the issue? Golfball for my minigolf VR game has some wierd collisions. As seen in the video the collisions cancel out randomly, about 20% of the time, which is not ideal. I have looked everywhere to why this happens, but i still can’t explain it.

Vid example of the issue:

1. What solutions have you tried so far? I tried removing the built in collisions and making my own force system that is applied to the golf ball when hit, but this soluion even tho working, it was not acurate and some strong hits came out as super weak and some weak hits came out as super strong.
Thats why i went back to built in collisions, as they were much nicer to hit and felt 10x better when it works, but that 20% of the hits makes it much worse.

It would be helpfull if you had an idea on how to fix this OR on how to make a better system my self.

When i coded the custom system i used the putters AssemblyLinearVelocity and applied it to the ball, after that i dampened it down untill it reached 0, but you can see how this can become inconsistent.

For more context this was my balls code when i did the custom force. In this code the dirrection of which the ball went were consistent, but the issue was in the force. I could swing with my full force and the ball would go just as strong or even weaker than a small weak swing. ← this was the reason built in colisions were much better at doing force, but with the collisions canceling issue.

``````ball.Touched:Connect(function(hit)
onBallCollision(hit)

local ballshit = Vector3.new(hit.Velocity.X, 0, hit.Velocity.Z) * 5

if hit.Name == "Head" and moving == false then
moving = true
hitsound:Play()
particle.Enabled = false
ball.Velocity += ballshit

while moving == true do
if ball.Velocity.X < 0.0001 and ball.Velocity.Y < 0.0001 and ball.Velocity.Z < 0.0001 then
print("went past")
moving = false
particle.Enabled = true
ballstopped:Fire("Continue")
end
end
end
end)

while ball do