Why can't I do "Model.Touched"?

As I’m trying to detect whenever a model is touched by a certain tool, I’m looking for a way tp detect whenever the model is touched, however, when I try to do “Model.Touched”, it doesn’t let me… I’m wondering if I could loop through every part and detect it that way, but surely there must be a better way to do this.

1 Like

Models don’t have a touched event, so you need to set a PrimaryPart to the model and use model.PrimaryPart.Touched:Connect

Yeah roblox is weird but if you wanted to you could make a “Hitbox” around the model and make that the primary part.

Models aren’t BaseParts. They’re a collection, like a folder, but they’re focused on storing Groups of Parts that make a single thing (like a Character). Since Models are just a collection of parts, with a bounding box, they don’t have their own collisions. The collisions of a model would be managed by amongst themselves, and therefore don’t have collisions.

To get when a Model is touched:

For accurate collisions: you’d want to use the Touch events for each part in your model, or the Assembly attached to the PrimaryPart.

For inaccurate collisions: You’d need to get the region of Model:GetBoundingBox(), and detect all parts in a Region3 with with Region and Size. Anything that wasn’t there before, or isn’t touching anymore (u can use an array to detect this), is a Touch or TouchEnded.

I wouldn’t recommended the inaccurate method, although I’ve included it since I’m unaware of your use case. Since it’s quite finnicky (not a bad thing, idk how else you’d do it), you’d need to Check Collisions every frame with RunService.PostSimulation.

Hope this helps you! Sorry if it’s a bit long and verbose

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.