TouchTransmitters / TouchInterests not created when changing the parent of a tool

Hey all, I’ve been working on my game recently, but I’ve run into an issue with something that I hoped would be a simple fix.

Goal: I want to clone a tool from a folder in a player to a player’s character.

Problem: A TouchTransmitter is not being created for the tool in question.

Here’s what I mean:
Normally, the descendants of tools typically look like this:
Screen Shot 2022-09-29 at 9.18.48 PM
Pretty simple, right?

Now, when not in workspace or a character model, the “TouchInterest” is gone. No problem, that’s not an issue.
However, what is an issue is the TouchInterest is not created when cloning the tool and setting the parent of said tool.

It causes it to look something like this:


As you can see there is a huge lack of the handle of the tool. I wonder where it went?
Screen Shot 2022-09-29 at 9.23.40 PM
I think you’re beginning to see the problem here.

What I’ve tried: I’ve searched through the devforum, but nobody else seems to be having this issue.
However, I do have 2 possible ways this might somehow be wrong:

First, here’s my code. To clear up, “Inventory” is a folder in the player’s character, with 5 children, all of which are folders named Slot1, Slot2, Slot3, ect. This is a localscript within a custom inventory GUI.

local inv = game.Players.LocalPlayer:WaitForChild("Inventory")

for i, child in ipairs(script.Parent:GetChildren()) do
	if child:IsA("ImageButton") then
		child.MouseButton1Click:Connect(function()
			local num = string.sub(child.Name, 5, 5) -- grabs the number of the slot
			
			for i, child in ipairs(game.Players.LocalPlayer.Character:GetChildren()) do
				if child:IsA("Tool") then
					if child.ToolTip ~= nil then
						child:Destroy()
					end
				end
			end
			local tool = inv["Slot" .. num]:FindFirstChildWhichIsA("Tool")

			for i, child in ipairs(script.Parent:GetChildren()) do
				if child:IsA("ImageButton") then
					child.BackgroundTransparency = 1
				end
			end

			script.Parent["Slot" .. num].BackgroundTransparency = 0.8

			if tool ~= nil then
				local newtool = tool:Clone()
				newtool.Parent = game.Players.LocalPlayer.Character

				script.Parent.ToolTip.Text = tostring(newtool:GetAttribute("fullname") .. " // " .. newtool.ToolTip)
			else
				script.Parent.ToolTip.Text = "Nothing"
			end
		end)
	end
end

However, if this is not the issue, this could also be a Roblox bug, but considering how this seems to only be effecting me, it’s probably something to do with my code.

Any help would be greatly appreciated!

UPDATE: I’ve changed the cloning of the tool to be server sided like so:

--local script
local newtool = script.Parent.CloneTool:FireServer(tool)

--server script
script.Parent.CloneTool.OnServerEvent:Connect(function(plr,tool)
	local newtool = tool:Clone()
	newtool.Parent = plr.Character
	return newtool
end)

But the issue persists, which confuses me further.

1 Like

So this is a bit embarrassing on my part…

While I did update it to be on the server for clicking the UI, I didn’t update it for an unseen part of the script where you press keys to do it.
And I neglected to test it by clicking it.

Oops.

2 Likes