I tried looking around the devforum but I just found individuals who were having issues with blacklisting/whitelisting certain parts. I am here because I am not really sure where to begin.
So I have a ray casted from the user’s torso into certain interact-able objects such as a shopkeeper inside of a market stall. The problem is that the ray should be ignoring the frame and only cast if the tarp covering the market stall is in the way. How would I go about doing this?
I took a read here but for the first option (FilterDescendantsInstances), it finds and ignores the descendants of an instance, correct? How would I go about using a table instead of an instance and then just iterate through the workspace and find if the instances have a certain attribute, and then use that table as the ignore parts?
well thats a hard question to answer, but you could use the collision groups and just deal with the instances that have certain attributes being in a collision group that doesn’t collide with the given collision group, but besides that i don’t know of a real way to do it
well stringRaycastParams.CollisionGroup
Specifies a collision group for the raycasting operation. Parts in collision groups that are set to not collide with this group will be ignored. If this property is omitted, the raycast will assume the Default collision group.
Yep, I just don’t understand how I would specify what to ignore and what not to ignore. The ray is just hitting a single part, or is it more that the ray becomes a part of the collision group?
basically you create a collsion group using physics service, then make another, then you set there collsions so that they dont collide with eachother
PhysicsService:CreateCollisionGroup(obstacles)
PhysicsService:CreateCollisionGroup(ignore)
-- add objects to collsion groups
PhysicsService:CollisionGroupSetCollidable(ignore, obstacles, false)
--[[
now use raycast.CollsionGroup while raycasting with one of the groups it will ignore
all the parts in the other group you would just add the parts to that group that you
want it to ignore and it will ignore them. of course this also actually cause them
to not collide with each other but that is a different problem.
]]