-
What do you want to achieve?
I have a destructible street light and a vehicle made by Roblox.
When it’s destroyed, the car keeps going and the parts still collide. -
What is the issue?
The street light itself works perfectly along with the effects but it stops the vehicle, which is not what I want. -
What solutions have you tried so far?
Tried CollisionGroups, ApplyImpulse - no/bad results.
Found three topics on devforum, but none of them helped me to fix the problem
Tried using ChatGPT and Bard. They just show funny results.
I also made the parts massless but I am not sure if it changed anything.
I tried to do it using hitboxes - but I can’t get how it’s supposed to work, because when I tried adding a hitbox to a car and another to the street light, which will check if it’s touched like this:
-- The street light sensor script
script.Parent.Touched:Connect(function(touch)
if touch.Name == "breaksensor" then
script.Parent.Parent.Main.isBroken.Value = true
script.Parent.Anchored = false
end
end)
It does work, and the value changes, whereas the other script in the streetlight, which breaks it:
local Ball = script.Parent.Parent.Main
repeat
script.Parent.Material = Enum.Material.Glass
wait(1)
script.Parent.Material = Enum.Material.Neon
wait(1)
until script.Parent.Parent.isBroken.Value == true
script.Parent.Material = Enum.Material.Glass
script.Parent.Parent.Parent.BrokenParts.Broken.Break:Play()
for _, child in pairs(script.Parent.Parent.Parent.BrokenParts:GetChildren()) do
child.Transparency = 0
end
for _, child in pairs(script.Parent.Parent:GetChildren()) do
if child:IsA("BasePart") then
child.Anchored = false
end
end
script.Parent.Parent.Parent.BrokenParts.Broken.Debris.Enabled = true
wait(0.1)
script.Parent.Parent.Parent.BrokenParts.Broken.Debris.Enabled = false
just unanchors all parts.
Sometimes car stops:
Sometimes not:
(used gifs because videos are always broken)
Maybe I should try using Raycasts or Welds, but can’t get of a idea how it would work.