Hello Ted here. How do I do this? I’m making a pong game to better my development skills. This part basically needs to clone from replicated storage into this screen and stay within these boundaries. My friend told me to “break it down” if I come across a problem, and this is the simplest way I could think of trying to dumb things down, but I still can’t get my head around a solution. Can someone help?
Are you using physics to move the ball, or just setting it’s CFrame every frame? If it’s the latter, you’ll need to use math to do collision detection between the ball and the walls. This is because you want the ball to bounce every time it hits a wall. Breaking this problem up, you’ll see that there’s really two separate problems:
- What does it mean for the ball to bounce?
- How do you detect that the ball has hit a wall?
Most math problems can be broken down by solving just one special case first, and then trying to figure out what makes the other case different from the solved case, and try to expand the specialized solution to the general case. Solving geometry problems is sometimes easier when you break it down into a 1D problem instead of 3D or 2D. This is one way of breaking a problem down into special cases. Both problems can be broken down in this way.
Hope that’s a good hint! If you’re still stuck that’s completely fine, the problems can be broken down even more without giving the solution away completely