Part's position isn't staying updated

so when the projectile hit’s something it creates a ball that increases size for a little bit but the ball isnt spawning where the projectile hits https://gyazo.com/a2e8f1bd796990d7da75715f6bcbb7c0

when i lower the body velocity on the projectile it doesn’t spawn as far and the other way around

Got the code for the creation of the ball? Plus how are you ensuring the projectile hit’s position are you using ray casting or .Touched?

local shootAnim = 1
script.Parent.shootevent.OnServerEvent:Connect(function(player,mouseHit,spawnPos)
	local char = player.Character
	local hum = char:FindFirstChild("Humanoid")
	local anim = nil
	if shootAnim == 1 then
		shootAnim = 2
		 anim = hum:LoadAnimation(script.Animation)
	else
		shootAnim = 1
		 anim = hum:LoadAnimation(script.Animation2)
	end
	anim:Play()
	wait(.3)
	local projectile = script.projectile:Clone()
	projectile.Parent = char
	projectile.Anchored = false
	projectile.Transparency = 0
	projectile.Fire.Enabled = true
	projectile.Trail.Enabled = true
	projectile.Position = spawnPos.Position
	local bv = Instance.new("BodyVelocity",projectile)
	bv.Velocity = CFrame.new(spawnPos.Position,mouseHit.Position).LookVector*1
	wait()
	bv.Velocity = CFrame.new(spawnPos.Position,mouseHit.Position).LookVector*100
	game.Debris:AddItem(projectile,3)
	wait(.2)
	projectile.Touched:Connect(function(hit)
		local effectp1 = script.effect:Clone()
		local effectp2 = script.effect2:Clone()
		game.Debris:AddItem(effectp1,10)
		game.Debris:AddItem(effectp2,10)
		effectp1.Parent = game.Workspace
		effectp2.Parent = game.Workspace
		effectp1.CFrame = projectile.CFrame
		effectp2.CFrame = projectile.CFrame
		projectile:Destroy()
		local canDamage = true
		effectp2.Touched:Connect(function(hit)
			local ehum = hit.Parent:FindFirstChild("Humanoid")
			if ehum and canDamage then
				canDamage = false
				ehum:TakeDamage(player.playerVars.playerLevel.Value*3)
				ehum:TakeDamage(6.5)
				wait(.125)
				canDamage = true
			end
		end)
		local bruh = 4
		repeat wait(.025)
			effectp1.Size = effectp1.Size + Vector3.new(.25,.25,.25)
			effectp2.Size = effectp2.Size + Vector3.new(.25,.25,.25)
			bruh = bruh - 1
		until bruh == 0
		wait(.2)
		effectp1:Destroy()
		effectp2:Destroy()
	end)
end)

also i am using .touched

Ah that may be the issue, .Touched has a bad notoriety of being unreliable and exploitable. You can either use a custom .Touched event or the popular FastCast community resource which is continually getting updates.

1 Like

ill check that out but i got it working fine by stopping the projectile when it hits and then making it wait for little bit and then spawning it thanks anyways

1 Like