I've tried GetTouchingParts, but that doesn't work since it only works with colliding parts. I've also tried Touched, but again, same problem. How do I tackle this problem? Edit: Sorry, I mean if the non-colliding part is inside it!
Math ;D I'm pretty happy with this.
01 | local part 1 size = workspace.part 1. Size |
02 | local part 1 position = workspace.part 1. Position |
03 | local part 2 size = workspace.part 1. Size |
04 | local part 2 position = workspace.part 2. Position |
05 |
06 | function checkX() |
07 | local x 1 , x 2 = part 1 size.X, part 2 size.X |
08 | local x = x 1 + x 2 |
09 |
10 | return (part 1 position.X + x > part 2 position.X or part 1 position.X - x < part 2 position.X) |
11 | end |
12 |
13 | function checkY() |
14 | local y 1 , y 2 = part 1 size.Y, part 2 size.Y |
15 | local y = y 1 + y 2 |