Touched
For thread safety, this property is not safe to read in an unsynchronized thread.
This event fires when one of the Humanoid|Humanoid's limbs come in contact with another BasePart.
The BasePart the Humanoid|Humanoid's limb is touching along with the limb itself is given.
This event will not fire when limbs belonging to the Humanoid come into contact with themselves.
Alternatives to the Humanoid Touched event
Although the Humanoid.Touched event is useful, developers should consider if there are alternatives that suit their needs better before using it.
- In most cases it is advised to connect a
BasePart/Touchedevent forBasePart|BasePartsof interest instead. This is because the Humanoid Touched event will constantly fire when the humanoid is moving. For example, in a dodgeball game it would be more practical to connect a touched event for the balls rather than the humanoid - For developers trying to work out when the
Humanoidhas landed on the ground, theHumanoid/StateChangedevent is more suitable. Alternatively, developers can useHumanoid/FloorMaterialto see if theHumanoidis standing on anything
Notes
- Connecting to this event will cause a
TouchTransmitterto be created in every limb - There is currently no equivalent of
BasePart/TouchEnded|BasePart.TouchEndedforHumanoid|Humanoids
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
|
|
The |
||
|
|
The limb of the |
Code Samples
Midas Touch
When placed inside a Player/Character model this code will give a player the ‘Midas touch’. Everything their character touches will change to gold.
When the Humanoid dies, this change is undone and the golden BasePart|BaseParts are returned to their original state.
To test this out, place this code inside a Script and place it in StarterCharacterScripts|StarterPlayer.StarterCharacterScripts.