Visual bullet issues

I have a perfectly working turret, however on the client side the bullets appear to be getting deleted early.

It looks fine on the server

I tried to just delete the bullet on the client side, but that didnt work. I also tried other methods of spawning bullets, but those methods dont give me the same results I want

This is the spawn bullet function:

local function fireBullet()
	-- Create the bullet part
	local bullet = Instance.new("Part")
	bullet.Size = Vector3.new(0.2, 0.2, 3)
	bullet.Shape = Enum.PartType.Block
	bullet.Color = Color3.fromRGB(255, 255, 0)
	bullet.Material = Enum.Material.SmoothPlastic
	bullet.CFrame = fireBulletPart.CFrame
	bullet.Anchored = false
	bullet.CanCollide = false
	bullet.Parent = workspace

	-- Set the bullet's velocity (initial speed in the direction it's fired)
	local velocity = fireBulletPart.CFrame.LookVector * BULLET_SPEED
	bullet.Velocity = velocity

	-- Detect collision with players or NPCs
	bullet.Touched:Connect(function(hit)
		if hit and hit.Parent and not hit:IsDescendantOf(script.Parent) then
			local hitParent = hit.Parent
			local humanoid = hitParent:FindFirstChild("Humanoid")

			if humanoid then
				humanoid:TakeDamage(1)
			end
			
			bullet:Destroy()
		end
	end)
	
	Debris:AddItem(bullet, 5)
end

For me it looks like FPS problem from the Client, that the FPS is capped.

1 Like

that’s actually a fair point, I’ll test by raising my personal settings

you’re right, I raised my fps settings and I can see the bullet travelling. I’ll probably just slow down the bullet a bit to allow people with lower frame rates to see it. thanks

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.