I’ve got this script that uses Linear Velocity to boost it. Everything works great but it spins violently which kinda makes it lose the immersion.
local GrenadePhysics = game.ReplicatedStorage.RemoteEvents.ThrowGrenadeClient
local DebrisService = game:GetService("Debris")
local ExplosionPosition
local function HandleMagicBottle(Player, SetCFrame, ThrowDirection)
if Player == game.Players.LocalPlayer then return end
local TrailBottle = game.ReplicatedStorage.EffectsFolder.MagicBottleTrail:Clone()
TrailBottle.Parent = game.Workspace
TrailBottle:PivotTo(SetCFrame)
local LV = Instance.new("LinearVelocity")
local Attachment = Instance.new("Attachment")
Attachment.Parent = TrailBottle.PrimaryPart
LV.Parent = TrailBottle.PrimaryPart
LV.Attachment0 = Attachment
LV.VectorVelocity = (ThrowDirection) * 100
task.wait(0.3)
LV:Destroy()
TrailBottle.w.Touched:Connect(function(hit)
if hit:IsA("Terrain") and not string.match(hit.Parent.Name, "ViewportHands") or hit:IsA("BasePart") and not string.match(hit.Parent.Name, "ViewportHands") then
print("CHECK")
print(hit)
if TrailBottle.PrimaryPart then
ExplosionPosition = TrailBottle.PrimaryPart.Position
end
TrailBottle:Destroy()
end
end)
end
GrenadePhysics.OnClientEvent:Connect(HandleMagicBottle)
How could i fix this?
Though I should point out the shape of the object.
