Spatial Queries
- Can be called at any time via a script
- If
BasePart.CanQuery
is equal to false for a part, it will not be affected / included when any of the following spatial query operations are called:GetPartBoundsInBox
GetPartBoundsInRadius
GetPartsInPart
-
Raycast
– Thanks to @Lielmaster for reminding me about this!
Another place to learn more about the CanQuery
property is in its announcement topic.
Touched
event
- Is only fired when two parts interact through physics simulations.
- This means that manually adjusting the CFrame of a part or Tweening a part won’t activate the
Touched
event upon coming into contact with another part.
- This means that manually adjusting the CFrame of a part or Tweening a part won’t activate the
(For this example, let’s assume we have two parts: Part A and Part B )
- If Part A is touched by Part B,
BasePart.CanTouch
has to be true for Part B or else theTouched
event won’t be fired on Part A.
To be honest, I forgot that Raycasts were considered spatial queries. I mostly associated those with the OverlapParams from this announcement thread since that was the first time I’d really heard the term.
The original list I included of the spatial query operations was based on the CanQuery
documentation page which didn’t include raycasting but I’ll be sure to add it to this post!