New Part Collision Property: CanQuery - Now Available!

Correct me if I’m wrong but doesn’t BasePart.Locked property exist for this purpose? I’m not sure why CanQuery should behave the same way in studio in full release when another property exist for that very specific reason.

Edit: My question is answered here:

13 Likes

My guess is its a slight performance boost like CanCollide and CanTouch both being set to false

but all of them together results in a significant boost for said part

7 Likes

Isn’t this what BasePart.Locked does?

I’m so thankful this is happening! I had to make functions that would filter out unsolid parts (which isn’t too complicated, but still needs the extra code), but now I can just turn off a property and have a simple raycast! Thanks!

7 Likes

Ah right, the answer’s in the OP lol. I guess we’re to take it as they all need to be set to off to see a minor performance boost, so it’s probably worth going through all of the nonessential parts in a game and doing so in the future.

3 Likes

This is one pretty useful feature for optimizing background elements you want to be completely be ignored.
I love how Roblox has lately worked more on updates like raycast and other optimizations, they are so much needed, they make the engine so much faster on older devices or devices with limited power.

16 Likes

Locked does something slightly different: Clicking on something that’s locked will specifically act as though you clicked on nothing. Clicking on something that’s CanQuery = false will currently act as though you clicked on whatever lies beyond it.

20 Likes

This is something especially needed for plugins. Being able to disable selection for specific parts (while having the dragger raycast pass through) is a feature I’ve been waiting for.

I got excited about this beta, but since preventing selection is unintentional behaviour, I’m a little disappointed now.

5 Likes

In Part.Locked the raycast still hits the part, but it is just not selected. With the CanQuery the raycast itself will ignore the part, that means you will be able to select a part behind a part, you are not able to do that with Part.Locked.

4 Likes

So will this allow a part with Query set to false to not be clicked by the draggers in studio? I always would try to set transparent parts (such as ones just to block players from wandering where they shouldnt) as locked only to be blocked when trying to click parts through them. It was very annoying, so I stopped using lock, as it really served no purpose for me.

6 Likes

Wondering if this somehow has something to do with the Pathfinding Service in the future. A nice addition to have though.

5 Likes

holy crap this is SO HELPFUL thank you so much Roblox, now i can finally ignore the HumanoidRootPart within raycasts for melees

6 Likes

FYI, you could always ignore or whitelist specific BaseParts in the Workspace. Just input a RaycastParams parameter to your Workspace:Raycast call:

local Workspace = game:GetService("Workspace")

local humanoidRootPart = ...

local raycastParams = RaycastParams.new()
raycastParams.FilterType = Enum.RaycastFilterType.Blacklist
raycastParams.FilterDescendantsInstances = { humanoidRootPart }

local origin = Vector3.new()
local direction = Vector3.new(0, 1, 0)

Workspace:Raycast(origin, direction, raycastParams)
10 Likes

Locked does not let you select parts behind the Locked part.

4 Likes

Will this work with Workspace:FindPartOnRay or is it just Workspace:Raycast?

4 Likes

isn’t that what locked is for lol

4 Likes

IIRC they both use the same raycast code internally, so I assume that it should still work properly in this case too

4 Likes

Reference to reply to this above:

3 Likes
3 Likes

oh, that definitely could use changing tbh

5 Likes

Explain Why it would need changing?

5 Likes