[SOLVED] - The Mathf.Clamp function doesn't set my boundaries correctly

I attempted to limit the paddle to not go off screen with math.clamp. However, the paddles boundaries don’t seem to be correct and they go off screen to the left and generates an invisible wall to the right. Even though the code is identical to the lecturers

[SOLVED] - My camera was not aligned with the bottom left-hand corner of the canvas.

you can see this bug in these images here.

I have also attached my project files below, any help will be appreciated truly!!!

Let’s Break Suma!.zip (7.1 MB)

Hi,

Based on the bottom two screenshots it looks like perhaps your playspace isn’t set to 0, 0 ,0?

Please note, it’s better to copy/paste your code and apply the code fencing characters, rather than using screenshots. Screenshots are ideal for displaying specific details from within a game engine editor or even error messages, but for code, they tend to be less readable, especially on mobile devices which can require extensive zooming and scrolling.

You also prevent those that may offer to help you the ability to copy/paste part of your code back to you with suggestions and/or corrections, meaning that they would need to type a potentially lengthy response. You will often find that people are more likely to respond to your questions if you make it as easy as possible for them to do so.

Hope this helps :slight_smile:


See also;

Privacy & Terms