Projectile being stuck in the air after spawning

So, I made a banana projectile. I want to launch it at my target.

The issue is that right before it launches, it waits for about 0.1 seconds and then launches making it very inaccurate and it just looks laggy.

local Assets = RS.Assets
local Banana = Assets.Projectiles.Banana

local function ShootBanana(Chicken, ShootCycle)
	local NewBanana = Banana:Clone()
	NewBanana.Name = "Banana"..ShootCycle

	NewBanana.CFrame = Chicken.HumanoidRootPart:FindFirstChild("eye"..ShootCycle).CFrame
	NewBanana.Parent = Chicken.Bullets

	local Values = Chicken.Values
	local Target = Values.FoundTarget.Value
	local Power = Values.Power.Value

	local direction = (Target.HumanoidRootPart.Position - NewBanana.Position).unit

	local bodyVelocity = Instance.new("BodyVelocity")
	bodyVelocity.MaxForce = Vector3.new(100000, 100000, 100000)
	bodyVelocity.Velocity = direction * Power
	bodyVelocity.Parent = NewBanana

	task.delay(5, function()
		NewBanana:Destroy()
	end)
end

I tried giving the velocity before the spawning but that also did not work.

The banana is launched at the target but first it is stuck for 0.1 seconds.

I gave up fixing this it’s lag… and just started doing.

Projectile.Transparency=1
Projectile.Parent=workspace
task.delay(0.33, function()
	Projectile.Transparency=0
end)

With a nice muzzle flash. Looks fine.

wont this keep the projectile very inaccurate? dodging it would be very very easy. thanks for the help thought. if i dont find anything else i might just do that as a placeholder and fix it later.

Using physics for a projectile can be glitchy, so I would recommend FastCast for your projectiles.

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