I'm attempting to use the Touched event on a single block that i'm CFraming into what i'm trying to detect. On the Roblox wiki's Touched event page it says that Touched does not fire when the block is CFramed into another. DO you know any workaround? If i use "block.Position = Vct3" the block moves on top of the objects which is undesirable. Same with MoveTo if i put the block in a model.
Images of the Ultimate Goal provided below: Wanted Outcome: http://prntscr.com/etrx9h Unwanted Outcome: http://prntscr.com/etrxg1
Thanks everyone!
Detection_Part.CFrame = CFrame.new(Mouse.Hit.p.x, Mouse.Hit.p.y+(Mouse.Hit.p.y/4), Mouse.Hit.p.z) --+ Detection_Part.Touched:connect(function(otherPart)
GetTouchingParts will do what you're looking for. It returns an array of all CanCollide true parts that are intersecting with the part you called it on, even when CFramed.
Unfortunately it's a method and not an event, so you'd have to stick it in a loop. For example,
while wait(0.5) do local parts = script.Parent:GetTouchingParts() for i, part in pairs(parts) do print(part) end end