The following code below is my concept of rocket bullet. I wanna ask how can I make it so that when it hits something, the adjoining parts of that hit part will be unanchored as well, the code is untested yet so tell me if it works and give me tips on how to make this rocket bullet effect better.
local rocketBullet = Instance.new(“Part”)
rocketBullet.Size = Vector3.new(0.5,0.5,2)
rocketBullet.Position = RocketHandle.CFrame.lookVector
local BV = Instance.new(“BodyVelocity”)
BV.Velocity = (Mouse.Hit.P - RocketHandle.Position).Unit
local explosion = Instance.new(“Explosion”)
BV.Parent = rocketBullet
rocketBullet.Parent = workspace
rocketBullet.Touched:Connect(function(hit)
if hit:IsA(“Part”) or hit:IsA(“MeshPart”) or hit:IsA(“UnionOperation”) then
explosion.Parent = rocketBullet
hit.Anchored = false
Debris:AddItem(rocketBullet,0.01)
end
end)