How to make a part be thrown away if it touches another when clicking?
Asked by
4 years ago Edited 4 years ago
Hello! I would like to make that when clicking on a specific part (part 1) only if it is touched by part2 at the moment of the click, the part2 is thrown away, how can I do something like that?
I would like it to be thrown away like when you throw a ball, this is for a baseball game and I want to do that when the bat tool touches the box and if at that moment the ball also touches the box then the ball is thrown far in the direction positive x
1 | local part = script.Parent |
2 | local click = part.ClickDetector |
4 | local function throwAway () |
8 | click.MouseClick:Connect(throwAway) |