I’m trying to implement a third person camera to my game, using this OTS system. However I have a small issue with the poppercam, it collides with parts, which are created by shooting a weapon. I want the camera to go through invisible/uncancollided parts by default, or at least these 3 parts I’ve tried to blacklist through the script, without success. Issue demonstrated in video:
This segment is used to blacklist parts from colliding with the camera. I tried to put a folder containing those parts there:
local folder = workspace:WaitForChild("Folder")
local raycastParams = RaycastParams.new()
raycastParams.FilterDescendantsInstances = {character, folder}
raycastParams.FilterType = Enum.RaycastFilterType.Blacklist
local raycastResult = workspace:Raycast(
humanoidRootPart.Position,
newCameraCFrame.p - humanoidRootPart.Position,
raycastParams
)
These 3 parts are cloned upon shooting the gun, through this piece of code:
--this part is the orange beam seen in the video
--local bullet = Instance.new("Part")
--bullet.Name = "Bullet"
local bullet = workspace.Folder.Bullet:Clone()
bullet.CanCollide = false
bullet.Transparency = 1
game.Debris:AddItem(bullet,0.4)
--this part spawns on the hit position
--local bullethit = Instance.new("Part")
--bullethit.Name = "BulletHit"
local bullethit = workspace.Folder.BulletHit:Clone()
bullethit.CanCollide = false
bullethit.Transparency = 1
game.Debris:AddItem(bullethit,0.4)
--this part spawns on the gun barrel
--local bulletblast = Instance.new("Part")
--bulletblast.Name = "BulletBlast"
local bulletblast = workspace.Folder.BulletBlast:Clone()
bulletblast.CanCollide = false
bulletblast.Transparency = 1
game.Debris:AddItem(bulletblast,0.4)
The parts which remain in workspace are actually see-through, but this behavior doesn’t transfer to the cloned parts. How would I make sure that the parts preserve that behavior even after cloning them?