Answered by
6 years ago Edited 6 years ago
Hey there! This has to do with Mouse.TargetFilter
. Essentially, your mouse is hitting the coordinate point on top of the brick over and over again, which is what causes this effect.
To make this have the behavior you want, you need to ignore the part in question when deciding what coordinate point the mouse is hitting.
You can do this by simply modifying the mouse's TargetFilter
.
02 | local Player = game:GetService( "Players" ).LocalPlayer |
03 | local Part = game.ReplicatedStorage.Part |
04 | local mouse = Player:GetMouse() |
05 | mouse.TargetFilter = Part |
09 | Part.Parent = workspace |
10 | Part.CFrame = Loc+Vector 3. new( 0 ,. 5 , 0 ) |
11 | Part.Orientation = Vector 3. new( 0 , 0 , 0 ) |
In this revised code we tell the hit detection to completely ignore this part.
TargetFilter
can be a BasePart
, Model
, or anything of the sort. All descendants
of TargetFilter
will also be ignored.