Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Touched event on brick not working?

Asked by
pwx 1581 Moderation Voter
5 years ago
local Part = Instance.new('Part', workspace)
Part.Size = Vector3.new(4,4,4)
Part.Transparency = .5
Part.CanCollide = false
Part.Anchored = true
shoutPart.Position = Tool.Parent.HumanoidRootPart.Position + Tool.Parent.HumanoidRootPart.CFrame.lookVector * 5

local goal = {}
goal.CFrame = Tool.Parent.HumanoidRootPart.CFrame * CFrame.new(0,0,-20)
local tweenInfo = TweenInfo.new(1) -- time
local tween = TweenService:Create(shoutPart, tweenInfo, goal)
tween:Play()


shoutPart.Touched:connect(function(otherPart)
                print('xd')
            end)

It prints nothing in the output/console upon it touching a part. Even when it clearly does like so:

https://gyazo.com/51798f641ceae1258883d7d04c5b1da5.gif

Why doesn't this work?

1
use rotated region3; the touched event is not reliable TheluaBanana 946 — 5y
0
Gotcha, will do. pwx 1581 — 5y
0
Capital C for Connect despicablejack2005 83 — 5y
0
Also do you set the value of shoutPart? despicablejack2005 83 — 5y
0
You should try using remote events. Trollapse 89 — 5y

Answer this question