I need help with raycasting object that moves

Hello devs!

I am making some sort of snowball fight game (4fun) and I need help with raycasting.
When the snowball is thrown by a player, sometimes the raycast doesn’t work.
If the snowball hits something, it just destroys itself.
The snowball relies on Roblox gravity and the direction it’s thrown.
I was trying to find the solution but nothing worked.

Example Script:

local Players = game:GetService("Players")

local Tool = script.Parent
local Animations = Tool.Animations
local Remotes = Tool.Remotes
local Config = Tool.Configuration
local Particles = Tool.Particles

local SnowballTemplate = Tool.Handle

local ThrowRE = Remotes.Throw
local ThrowAnim = Animations.Throw

local Debounce = false

local PlayerDebounces = {}

local RayParams = RaycastParams.new()
RayParams.IgnoreWater = true
RayParams.FilterType = Enum.RaycastFilterType.Exclude

ThrowRE.OnServerEvent:Connect(function(Plr, MousePos : CFrame)
	SnowballTemplate.Transparency = 1

	RayParams.FilterDescendantsInstances = {Plr.Character}

	local NewSnowball = SnowballTemplate:Clone()
	NewSnowball.AssemblyLinearVelocity = MousePos.LookVector * 200
	NewSnowball.Transparency = 0
	NewSnowball.Trail.Enabled = true
	NewSnowball.Parent = workspace

	local Position = NewSnowball.Position
	local Velocity = MousePos.LookVector.Unit * 200

	local LastPosition = NewSnowball.Position

	local RayCast = coroutine.wrap(function()
		while task.wait() do
			local deltaTime = task.wait() 
			local NewPosition = Position + Velocity * deltaTime

			local Result = workspace:Raycast(Position, NewPosition - Position, RayParams)

			if Result and Result.Instance then
				print(Result)
				local Player = Players:GetPlayerFromCharacter(Result.Instance.Parent)

				if Player then
					if PlayerDebounces[Player] then
						return
					end

					PlayerDebounces[Player] = true

					local Character = Player.Character
					local Humanoid = Character.Humanoid

					Humanoid:TakeDamage(Config.Damage.Value)

					task.wait(1)
					PlayerDebounces[Player] = false
				end

				NewSnowball:Destroy()
				break
			end

			Position = NewPosition
		end
	end)

	RayCast()

	task.wait(Config.Cooldown.Value)
	SnowballTemplate.Transparency = 0
end)

The snowball can go through terrain and other models if it’s thrown far away.

Is the snowball spinning when thrown? That will affect the raycast direction.

It’s not spinning when thrown, only falling down due to gravity.

Are you sure?
As far as I can see you’re applying a LinearVelocity to it, but not doing anything to keep the Orientation.
Can you confirm by selecting the snowball with the Move tool as it’s being thrown? The arrow handles will show you if it’s spinning or not.