I have these dominoes in my game, I want the player to not be able to walk over them, but be able to shoot (raycast) over them.
This is the hierarchy of a domino. Domino is CanCollide = false and CanQuery = false; InvisPart is CanCollide = true
This is my filter, Filter = {Player.Character, <AllDominoModels>}
I’ve tried setting CanQuery of InvisParts to false (CanCollide stays true) via script on runtime, but the raycast is still hitting the InvisPart of the dominoes. I am sure the raycast is hitting the InvisPart, I printed it.
That was my initial approach, I had every InvisPart in the table, realised it gets descendants, then put every model in the table (taking out the InvisParts), still didn’t work. Tried setting CanCollide of the meshpart to true as well, since I thought maybe it’s not getting down to the InvisParts, since their parent has CanCollide off, but no luck, still doesn’t work.
Are you sure you took correctly did the initial approach?
Local Item = — Any model:item, in this case your domin
Local Filter = {} — ur table
for i,v in pairs(Items:GetDescendents()) do
if v:IsA(‘Part’) and v.Name == "InvisPart" then
table.insert(Filter, v)
end
end
Oh my… My obvious mistake hit me right in the face just now. Problem solved. The dominoes are a part of a map, which I’m cloning from ServerStorage. I was putting the original dominoes, not cloned ones, into the table Sorry guys
Do you add dominos after setting the filter Descendants. I had a problem a while ago where my ray casts were ignoring parts I had in a table because I was adding parts to the table but not updating the ray params