You can write your topic however you want, but you need to answer these questions:
-
What do you want to achieve? Keep it simple and clear!
My goal was to detect what a part touched for a script using touch events -
What is the issue? Include screenshots / videos if possible!
the part I’m trying to make activate when it is touched is the cylinder in the video it has the same code as the dummy but the dummy actually has its touch event activated the cylinder does not but i need the cylinder to activate it but it just wont. Some parts do activate it like a part in the work space but why that does and nothing else does is a mystery
-
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
nothing that i found matched my probelm
After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!
-- context list --> {[1] unit, [2] hum, [3] humRoot, [4] currentTask, [5] doingTask} --
-- This is an example Lua code block
```lua
module.findTree = function(context)
local bool = false
local target = nil
local minDistance = nil
local touchTable = {}
local cylinder = Instance.new("Part")
cylinder.Shape = Enum.PartType.Cylinder
cylinder.Size = Vector3.new(1, 10, 10)
cylinder.Position = context[3].Position
cylinder.Anchored = true
cylinder.CanCollide = false
cylinder.Parent = context[1]
cylinder.Orientation = Vector3.new(0, 0, 90)
cylinder.Transparency = 0
cylinder.Touched:Connect(function(hit)
print(hit.Name)
end)
context[3].Touched:Connect(function(hit)
print(hit.Name)
end)
local runService
runService = RS.Heartbeat:Connect(function()
if bool == true then
bool = false
--cylinder.CanTouch = false
--wait()
--cylinder.CanTouch = true
end
end)
end
return module