Making a plane crash detection system

The best way that I’ve seen for this is to make invisible “collision” parts (set CanCollide to false on them, make them transparent, but listen for .Touched event on all of them). On touched, measure the magnitude of the current velocity (collisionPart.Velocity.Magnitude), and decide how much damage to do.

For example:

collisionPart.Touched:Connect(function(part)
   local mag = collisionPart.Velocity.Magnitude
   if mag > 50 then
      -- Do damage
   end
end)
3 Likes

Would these parts have to avoid intersecting with the plane’s parts for this technique to work?

Probably. Easy to do though. Just check if the part touched is a descendant of the plane model:

collisionPart.Touched:Connect(function(part)
   if part:IsDescendantOf(planeModel) then return end -- Add this
   local mag = collisionPart.Velocity.Magnitude
   if mag > 50 then
      -- Do damage
   end
end)
3 Likes

@ObsidianRook Look at the reply @omgcchheeessee gave above. He sent you a model with code in it - you should probably look at it to see if it’ll work for you.

1 Like

@omgcchheeessee Hey, thanks for this! I tried using it and for some reason it didn’t work - I can’t figure out why, but I appreciate the effort you went to.

@MJTFreeTime Thanks for reminding me - I forgot to reply to tell him I checked it.

To anyone else who may see this, I found a solution - turns out the collision detection from Crazyman32’s biplane free model already implements an improved version of @sleitnick’s suggestion for how to handle the issue and it can be easily ported into just about any plane model - so that’s what I’ve done. Thanks to everyone who responded to this thread for all the help!

2 Likes

I am crazyman32 lol (just changed my username a few days ago). Glad the biplane setup worked for you.

4 Likes

I thought I recognised that hat! Thanks for your help!

1 Like

I noticed that you changed your name when I looked at the smoothcam plugin

Well the code has to be edited. I didnt just make it copy paste.