How do I detect sudden stops of an object?
I need this to detect when the car crashes.
You can do BasePart.Touched
2 Likes
Yes I tried that but it’s not working very well, so my car suspension is physical not with thrusters so it touches unwanted parts.
Do you know how to make so touched function doesn’t detect unwanted parts, blacklist kind thing?
You can do like
local VehicleModel = --path to vehicle model
Part.Touched:Connect(function(Part)
local current = Part
while Part.Parent ~= nil do
if current.Parent == VehicleModel then
--Touched part is part of VehicleModel so skip
return
end
current = Part.Parent
end
)
1 Like
The thing is that touched event detects non collidable parts too. So maybe I can somehow do so if can collide is false then touched function doesn’t detect it
Then do
Part.Touched:Connect(function(Part)
if Part.CanCollide == false then return end --skip not collidable part
local current = Part
while Part.Parent ~= nil do
1 Like
that’s what I needed, thanks,
1 Like