Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Detect whether something has entered a region?

I'm trying to create a script that detects if an object has entered a region. Basically it checks and if something enters an area, it activates something. When it leaves, it activates something else. I've tried scripting it but I cannot get it to work properly. Any ideas?

5 comments

0

What do you exactly mean by Region? So, does it mean, like for example a folder, and if a part gets added to it then something triggers? Or a specific area(Vector3)? Or a few for example, if anything gets added in a folder called ej8, or a model called 92138kda? Please be a little more specific. Thanks!

0

Region3

0

As In if something enters a specific area then it triggers something.

0

Can you provide more specifics? There are different ways to do this with just bounds checks, or with parts and Touched events. Depending on the size and number of these regions, and how many parts are going in and out, one solution might scale better than another.

0

How fast the object is moving matters too, particularly if the region is small too. If the object is moving fast enough, many frame or Touch event based detection methods will fail to detect it.

1 answer

This discussion is preserved as it was. New answers, comments, and votes are closed.