Question on mouse position

My block breaker project has strange behaviour compared to what was shown in the tutorial. There is a gap between my mouse and the paddle. I tested by creating a new project and inserted only the paddle and the script, only to find that the behaviour remains the same. So it looks like something in the tutorial is not up-to-date. Or there’s strange behaviour with Windows Unity. I’m not sure which. I have removed the picture taken for my project but I can take it again. This picture is the next one taken and there’s still a gap between the paddle and the mouse.

Hi,

This will be a huge exception and a favour: Please upload your project folder to GitHub (without the Library and the Temp folder). I’ll try to fix the issue for you as an exception with Unity 2019.3, for this specific problem only, and I’ll send a pull request with the solution, which you will hopefully be able to accept.

Here is a tutorial by Brackeys:

Nina,
I’m not an expert in sourcetree yet. Could you just let me know what the problem is if i were to upload the project? Let me know if you can agree with this. No big hurry for me. Yes I’m already using sourcetree and can upload the project without the guide. Thank you anyway.

For the record, I’m thinking of just using some internet solution. Looking through the unity learn and manual might take some time.

It depends on how much I have to change in your project. If it’s just one value, I can simply tell you that. I don’t have time to write a lengthy explanation/tutorial, though. I suspect that the camera is at the wrong position. Or one of the other values is not correct. I think I already asked you to check them in one of your other threads, so I’ll simply do myself what I already suggested there.

Project is here - https://github.com/JulianHSC/GlitchGarden-forNina. Set to public already.

I’m afraid that’s the wrong project. You asked about Block Breaker.


A reminder for myself: your thread on Udemy

Sorry. This is the correct link: https://github.com/JulianHSC/Block-Breaker-for-Nina

I’ll probably check it in a couple of days/weeks.

when i was on that game i got the same error, i fixed by moving everything to the right X

Can you show me a screenshot? I have no idea what you mean. And I’m using windows which I understand is more sensitive and have more bugs than macintosh. What system are you using?

I’ve checked your game and tested the Level 1 scene. Everything I asked you to do in your other thread(s) on this issue was not done in that scene. Almost all values are completely different than Rick’s.

  • The camera position must be set to (8, 6, -10).
  • The camera size must be set to 6.
  • The pivot point of the background image must be set to “bottom left” in the Import Settings.
  • The Pixel Per Units value could be set to 90.
  • The resolution in the game window must be set to 800 x 600.
  • The Playspace must be set to (0, 0, 0).
  • and a lot of other things, which takes too much time to list

I sent you a pull request on GitHub with the fixed Level 1 in Unity 2019.3.6f1 which you can accept. If that doesn’t work, check the changes on GitHub. Alternatively, rewatch all videos and make sure that everything is done exactly as Rick showed it.

Yes. I tried to do some of those earlier and it didn’t make my project look better so it looks like I didn’t follow. I did mention that I finished this project earlier before. What I didn’t tell you is i didn’t follow everything and it did work quite well. I’ll check this again once I’m done with glitch garden. Do wait.

I’ve quickly edited the app. I tried to play but now i see that the mouse can only move from side to center to move the paddle. Is this normal? See my screenshot. You can see my mouse.

Did you accept my pull request on GitHub?

Sorry. I can’t accept as I don’t use version 2019.3. It’s not stable. Is this ok? I don’t know how to accept the pull request. I don’t know sourcetree fully yet. I’ll try it soon.

Could you let me know which 2019 unity you are using? There are many versions.

I tested your project and fixed that one level with 2019.3.6f1. I changed two files. If you cannot accept the pull request for whatever reason, you could simply copy and paste the text from GitHub into your own files. The changed files can be found in the pull request.

You can move paddle with this piece of code.

[SerializeField] Camera sceneCamera; // DRAG YOUR  CAMERA;


    void Start(){
        if(!sceneCamera) sceneСamera = FindObjectOfType<Camera>();}

    void Update(){
        MovePaddle();}

    void MovePaddle(){
        Vector3 newPos = sceneCamera.ScreenToWorldPoint(Input.mousePosition);
        newPos.y = transform.position.y; newPos.z = transform.position.z;
        transform.position = newPos;}

Where do i insert the code? In camera or in the paddle?

Paddle.cs.

Thank you Nina. I’ll try that soon.

Privacy & Terms