Touch Interest Not Appearing

Note: I am not 100% sure if this is in the right category so please tell me if it is not.

Hello All,
So I am making a game with a ball that you through and If someone touches it they have the ball (kinda like hot potato). The ball is shooting out fine, but the touch interest is not appearing. I feel like I am doing something dumb. I even tried cloning a ball with working touch interest from workspace, but the touch interest just disappeared.

This is the script:


local DebrisService = game:GetService("Debris")
local PlayersService = game:GetService("Players")
local Player = PlayersService.LocalPlayer 

local Tool = script.Parent
local ToolHandle = Tool:WaitForChild("Handle")

local Gravity = 90
local ThrowSpeed = 90
local ReloadTime = 1.75
local Lifetime = 50

local ThrowedRock = game.Workspace.DemoBall



local bodyForce = Instance.new('BodyForce',ThrowedRock)
bodyForce.Name = 'ThrowForce'
bodyForce.force = Vector3.new(0, ThrowedRock:GetMass() * Gravity, 0)

function OnActivated()
local Character = Player.Character
if Tool.Enabled and Character and Character:FindFirstChild('Humanoid') and Character.Humanoid.Health > 0 then
Tool.Enabled = false

local ThrowedRockClone = ThrowedRock:Clone()
--DebrisService:AddItem(ThrowedRockClone,Lifetime)
	
local Rock_Spawn_Position = (ToolHandle.CFrame * CFrame.new(0, 0, 2.25)).p
ThrowedRockClone.CFrame = CFrame.new(Rock_Spawn_Position, Character.Humanoid.TargetPoint)
ThrowedRockClone.Velocity = ThrowedRockClone.CFrame.lookVector * ThrowSpeed
ThrowedRockClone.Parent = game.Workspace

wait(ReloadTime)
Tool.Enabled = true
 end
end




Tool.Activated:connect(OnActivated)

Any help will be appreciated.

1 Like

You didn’t assign a Touch event to the ball yet:

Thing.Touched:Connect(function(hit)
    -- code
end)
1 Like

Yeh, sorry, I already had that in the ball that I cloned. I tested it out and it works but it is when you clone it that it just dissapears

You have to do it again for the new object cloned.

ok, do you mean like inserting another script into the part or …?

If that script contains the touched event, then yes, you do.

BasePart.CanTouch = true

This should be enabled by default but might be disabled on the part you’re cloning.

TouchTransmitter instances are automatically created providing the BasePart instance can be touched and some script has a Touched event listener for the aforementioned BasePart (you don’t need to clone a BasePart instance with one inside).

local DebrisService = game:GetService("Debris")
local PlayersService = game:GetService("Players")
local Player = PlayersService.LocalPlayer 
local Character = Player.Character or Player.CharacterAdded:Wait()
local Humanoid = Character:WaitForChild("Humanoid")

local Tool = script.Parent
local ToolHandle = Tool:WaitForChild("Handle")

local Gravity = 90
local ThrowSpeed = 90
local ReloadTime = 1.75
local Lifetime = 50

local ThrowedRock = workspace:WaitForChild("DemoBall")

local BodyForce = Instance.new("BodyForce")
BodyForce.Parent = ThrowedRock
BodyForce.Name = "ThrowForce"
BodyForce.force = Vector3.new(0, ThrowedRock:GetMass() * Gravity, 0)

function OnActivated()
	if Tool.Enabled and Character and Character:FindFirstChild('Humanoid') and Character.Humanoid.Health > 0 then
		Tool.Enabled = false

		local ThrowedRockClone = ThrowedRock:Clone()
		--DebrisService:AddItem(ThrowedRockClone,Lifetime)

		local Rock_Spawn_Position = (ToolHandle.CFrame * CFrame.new(0, 0, 2.25)).p
		ThrowedRockClone.CFrame = CFrame.new(Rock_Spawn_Position, Humanoid.TargetPoint)
		ThrowedRockClone.Velocity = ThrowedRockClone.CFrame.lookVector * ThrowSpeed
		ThrowedRockClone.Parent = game.Workspace

		task.wait(ReloadTime)
		Tool.Enabled = true
	end
end

Tool.Activated:connect(OnActivated)

I have already tried that, the ball that is in workspace when I test it has touch interest as a child, but when it is cloned it loses that touch interest. I am very confused right now

It is all good, I managed to use a replica ball that I welded to the ball in the script, which isn’t cloned meaning it keeps its touch interest. Not the most efficient way, but it works :grinning:. Thanks for all the help anyways.

1 Like