Team Spartan Cookies & Milk Forums
What's the best way to detect if a ship is parented to the chip? - Printable Version

+- Team Spartan Cookies & Milk Forums (https://teamscm.co.uk)
+-- Forum: Garry's Mod (https://teamscm.co.uk/forum-4.html)
+--- Forum: Starfall (https://teamscm.co.uk/forum-7.html)
+--- Thread: What's the best way to detect if a ship is parented to the chip? (/thread-3604.html)



What's the best way to detect if a ship is parented to the chip? - 57e11a - 26-01-2021

So I'm trying to check if the ship is parented to the chip, my previous way was
#constraint.getAllConstrainedEntities(ents.self()) == #ents.self():getChildren()
But this doesn't work when there are subchildren, entities parented to entities parented to the chip, like a SBEP door parented to it's controller.
Does anyone have a better idea that I could use?