Teleported part not firing touched event?
Howdy. I have a part (call it part A) that is inside a doorway of sorts. Another script teleports a new part (call it part B) inside of part A.
Part A has the following script:
04 | if part.Parent.Name = = "Room" then |
06 | script.Parent.Parent.OpenEnds.Value = script.Parent.Parent.OpenEnds.Value - 1 |
07 | script.Parent:Destroy() |
10 | script.Parent.Touched:connect(onTouch) |
The code that teleports part B into part A:
1 | roomModel.Parent = game.Workspace |
3 | roomModel:SetPrimaryPartCFrame(CFrame.new(position)) |
4 | if roomModel.PrimaryPart.Position.Y > script.Parent.Position.Y then |
The way part B is teleported is in a SetPrimaryPartCFrame. As a result, part B teleports inside part A. The problem I am having is that it seems that the onTouch function is not firing, as neither "Touched" nor "Room" print. Even though part B is CFramed into part A, part A's script does not register them as touching. Thanks in advance.