Description
Property of RaycastParams.new() called “RespectCanCollide” doesn’t respect CanQuery over CanCollide property of a part, when calling a WorldRoot:Raycast() method with RaycastParams being a parameter.
This code creates a Raycast based on your mouse position and then prints the RaycastResult. It also demonstrates how RespectCanCollide is set to false.
This video shows how TestPart still gets detected, even though CanQuery is off and RespectCanCollide is set to false. CanCollide is still on.
Expected behavior
I expect for TestPart not to be detected whenever I hover it when it has CanQuery off, and Raycast paramater “RespectCanCollide” set to false.
Um pretty sure respectcancollide’s default value is false. So I don’t think you’re changing anything. False will mean that it will only whitelist parts that have canquery off. SO in theory it shouldn’t be detected so I’m not sure why it is, try setting it to true. Even though in theory it will take the cancollide value instead of canquery. Try it anyways, if that doesn’t work try messing around with cancollide. I’m not sure if you can turn canquery off without turning cancollide off too though. So maybe that might be a problem.
Edit: Yes, you cant turn canquery off without turning cancollide off. So that may also be the reason why it isn’t working.
Edit2: “So I don’t think you’re changing anything. False will mean that it will only whitelist parts that have canquery off.” I wrote that wrong, meant to say that parts will be ignored if canquery is off. The parts which have canquery off of course.
I believe CanCollide having any effect on Raycast detection while RespectCanCollide is set to false is not expected behavior. That’s why I posted this bug report.
I thought it was scripting support my bad. But maybe give the things I said a test anyway so that if they do work/not work in intended/unintended ways you can add that to the report?
Sorry for the confusion. Below is the doc for RespectCanCollide
This property, if true, makes the raycast operation use an intersected part’s CanCollide value in favor of its CanQuery value when determining whether that part is included in the RaycastResult.
By default, it’s false, When it false, the override is disabled.
CanQuery determines whether the part is considered during spatial query operations, such as GetPartBoundsInBox or Raycast. CanCollide must also be disabled when disabling CanQuery. These functions will never include parts whose CanQuery and CanCollide is false.