TouchTransmitter

Show Deprecated
Not Creatable
Not Browsable

An internal object used by networking and replication code to transmit BasePart.Touched and BasePart.TouchEnded events.

The TouchTransmitter object named 'TouchInterest' is created and parented to a BasePart when the BasePart.Touched or BasePart.TouchEnded events are listened (connected) to.

Removing the TouchTransmitter will prevent the touched events from working. The TouchTransmitter object can also be removed exclusively on the client (when Workspace.FilteringEnabled is set to true). This will prevent collisions from models the client has network ownership of (such as the player's character) from registering.

Note, in almost all circumstances developers should disconnect the connection using RBXScriptConnection:Disconnect() method rather than removing the TouchTransmitter. Otherwise the connection will not be cleaned up which can cause performance issues over time.

Code Samples

TouchTransmitter

1local part = Instance.new("Part")
2part.Anchored = true
3part.Position = Vector3.new(0, 1, 0)
4part.Parent = workspace
5
6part.Touched:Connect(function()
7 print("part touched!")
8end)
9
10local touchTransmitter = part:WaitForChild("TouchInterest")
11if touchTransmitter then
12 print("removing TouchTransmitter!")
13 touchTransmitter:Destroy()
14end

Summary

Properties

Events

Methods

Properties

Events

Methods