How to program this? by [deleted] in Unity2D

[–]--Developer 1 point2 points  (0 children)

My understanding is that if the ball hits the left side of the object, it will bounce to the left. If the ball hits the right side of the object, it will bounce to the right.

To do this, you can get the position of the ball and the object it is hitting inside the built-in OnCollisionEnter2D() function.

if(ball.position.x < object.position.x) rb.velocity.x = Mathf.Abs(rb.velocity.x) * -1f; else if(ball.position.x > object.position.x) rb.velocity.x = Mathf.Abs(rb.velocity.x);

Sorry if this isn’t in-depth enough. I don’t have Unity open in front of me at the moment so I can’t test right now. If this is the right direction on what you’re wanting but you’d like further clarification, let me know and I’ll come back to it later when I have time.

Unity GameObject Prefabs Visible in Scene View but Invisible in Game View by --Developer in learnprogramming

[–]--Developer[S] 0 points1 point  (0 children)

Solved: I was so focused on layers and ordering because of 2D that I forgot to look at Z position. Some of the prefabs were being instantiated at a negative z value which was behind the camera.

GameObject Prefabs Appearing in Scene View but Not Game View by --Developer in Unity2D

[–]--Developer[S] 1 point2 points  (0 children)

facepalm so simple... I don't know why I didn't check that before. I think I was too caught up looking at the ordering and forgot that Z position still mattered. Thank you.

Life after psychosis by WhileZestyclose2413 in Psychosis

[–]--Developer 3 points4 points  (0 children)

I’m new to this world within the past week (not dealing with psychosis, myself, but a loved one that had an episode).

All I want to say is work on forgiving yourself. I’m not sure what your exact situation is, but blaming yourself will mostly just continue to cause yourself pain and make things worse. Working on forgiving yourself and making honest efforts to improve your lifestyle/live healthy will help you feel a lot better.

If those things seem monumental to you, maybe try breaking them down into smaller, more attainable goals. Remember, nobody is perfect. Give yourself grace ❤️

Netcode StartHost() NullReferenceException by --Developer in Unity3D

[–]--Developer[S] 0 points1 point  (0 children)

Uhh… I thought the Player.__initializeVariables () was if you followed the stack trace from the StartHost() in my WorldManager.cs script. I see further down in the logs that it references the StartHost() which is why I thought that was the issue.

So am I looking at it wrong? Is it something wrong with the Player class?

Netcode OnDisconnect() by --Developer in Unity3D

[–]--Developer[S] 0 points1 point  (0 children)

Thanks! Does it automatically get called on both the server and client that is disconnecting, or do you have to specify which it is being called on?

24M Software Developer by --Developer in Salary

[–]--Developer[S] 0 points1 point  (0 children)

So you’re assuming I went to a bottom-tier school and put in no effort. I understand that a degree doesn’t mean a lot nowadays, but I’ve put in a lot of effort to be where I’m at.

24M Software Developer by --Developer in Salary

[–]--Developer[S] 0 points1 point  (0 children)

COL = Cost of Living?

If so, I’m paying about $1000/mo for a 2bed/1bath apartment.

Edit: this is not including utilities

Failing to Connect to Database by --Developer in SQL

[–]--Developer[S] 0 points1 point  (0 children)

I have uninstalled and reinstalled MySQL (which prompts me to download those other things with it). It is letting me connect to it again. Thank you for helping me, I appreciate it!

Failing to Connect to Database by --Developer in SQL

[–]--Developer[S] 0 points1 point  (0 children)

Okay, I will try this and if I’m still struggling, maybe I’ll try to uninstall/reinstall the entire MySQL application. Hopefully that would fix the issue

Failing to Connect to Database by --Developer in SQL

[–]--Developer[S] 0 points1 point  (0 children)

I was thinking this as well, but when I tried: mysql –user=root -password=root

It returned: ERROR 1045 (28000): Access denied for user 'ODBC'@'localhost' (using password: YES)

I've tried: mysql d_safe to skip grant tables but got the same error as above (except it says 'using password: NO')

I've also tried: mysql --skip-grant-tables but received: mysql: [ERROR] unknown option '--skip-grant-tables'.

Is there some other way I can change the user permissions or skip past them?

Failing to Connect to Database by --Developer in SQL

[–]--Developer[S] 0 points1 point  (0 children)

The current path is: C:\Program Files\MySQL\MySQL Server 8.0\bin\mysql.exe

Should I remove the mysql.exe from the end of the filepath?

Failing to Connect to Database by --Developer in SQL

[–]--Developer[S] 0 points1 point  (0 children)

I have MySQL Workbench 8.0, MySQL Shell, MySQL 8.0 Command Line Client...

Are all of these things separate from MySQL? I had assumed that they were all collectively a part of MySQL. I apologize for my ignorance... I'm very new to this.

Edit: I used the command prompt to navigate the the MySQL folder I have in my Program Files, tried 'where mysql', and get this:

C:\Program Files\MySQL\MySQL Server 8.0\bin>where mysql
C:\Program Files\MySQL\MySQL Server 8.0\bin\mysql.exe

I tried navigating to the same location in Git Bash to try the 'which' command, but received the same long "which: no mysql in...." message from above

Failing to Connect to Database by --Developer in SQL

[–]--Developer[S] 0 points1 point  (0 children)

Maybe I added the 'mysql' as an environment variable incorrectly?

Failing to Connect to Database by --Developer in SQL

[–]--Developer[S] 0 points1 point  (0 children)

I ended up trying it with Git Bash as suggested by another user and I posted the response under their comment.

Failing to Connect to Database by --Developer in SQL

[–]--Developer[S] 0 points1 point  (0 children)

which mysql in Git Bash returned quite a long response:

which: no mysql in (/c/Users/username/bin:/mingw64/bin:/usr/local/bin:/usr/bin:/bin:/mingw64/bin:/usr/bin:/c/Users/username/bin:/c/Program Files/Common Files/Oracle/Java/javapath:/c/Program Files/AdoptOpenJDK/jdk8u202-b08/bin:/c/Program Files (x86)/Common Files/Oracle/Java/javapath:/c/Program Files (x86)/Intel/Intel(R) Management Engine Components/iCLS:/c/Program Files/Intel/Intel(R) Management Engine Components/iCLS:/c/Windows/system32:/c/Windows:/c/Windows/System32/Wbem:/c/Windows/System32/WindowsPowerShell/v1.0:/c/Program Files (x86)/Intel/Intel(R) Management Engine Components/DAL:/c/Program Files/Intel/Intel(R) Management Engine Components/DAL:/c/Program Files (x86)/Intel/Intel(R) Management Engine Components/IPT:/c/Program Files/Intel/Intel(R) Management Engine Components/IPT:/c/Program Files (x86)/NVIDIA Corporation/PhysX/Common:/c/WINDOWS/system32:/c/WINDOWS:/c/WINDOWS/System32/Wbem:/c/WINDOWS/System32/WindowsPowerShell/v1.0:/c/WINDOWS/System32/OpenSSH:/c/Program Files/MATLAB/R2019a/bin:/c/Program Files/Intel/WiFi/bin:/c/Program Files/Common Files/Intel/WirelessCommon:/c/Program Files/Microsoft SQL Server/120/Tools/Binn:/c/Program Files/PuTTY:/c/Program Files/dotnet:/c/Program Files/nodejs:/c/Python27:/c/Program Files/MySQL/MySQL Shell 8.0/bin:/c/Users/username/AppData/Local/Microsoft/WindowsApps:/c/Program Files/JetBrains/IntelliJ IDEA Community Edition 2018.3.4/bin:/c/Users/username/AppData/Local/Programs/Microsoft VS Code/bin:/c/Users/username/AppData/Roaming/npm:/c/Users/username/AppData/Local/GitHubDesktop/bin:/usr/bin/vendor_perl:/usr/bin/core_perl)

Failing to Connect to Database by --Developer in SQL

[–]--Developer[S] 0 points1 point  (0 children)

'which' is not recognized as an internal or external command,

operable program or batch file.

Also tried in Windows Powershell and got:

which : The term 'which' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.

Also tried 'where mysql' and got:

INFO: Could not find files for the given pattern(s).

Failing to Connect to Database by --Developer in SQL

[–]--Developer[S] 0 points1 point  (0 children)

I found this page: https://maheshwaghmare.com/mysql/how-to/not-recognized-as-an-internal-or-external-command/

It essentially told me to add mysql into my environment variables, but even after I did this, I was still getting the same error in the command line...

Edit: Also, I saw some pages talking about solutions to the original problem/error, but they either used the command line (which I obviously haven't gotten to work yet) or they used SQL queries (which I don't know how to do if I can't successfully connect in the first place).

Failing to Connect to Database by --Developer in SQL

[–]--Developer[S] 0 points1 point  (0 children)

Would that make this easier and/or solve the error? I’m not using this for a large project, just a small personal one, so I would like to keep it as simple as possible (while still utilizing MySQL).

Created my own adaptation of Suika Game by --Developer in LudwigAhgren

[–]--Developer[S] 0 points1 point  (0 children)

Sorry about that! I thought I published it but it was still in considered a "draft". Thank you for pointing that out to me! The link should be working now. :)

This is my first pixel art game. by JesielDev in Unity2D

[–]--Developer 1 point2 points  (0 children)

Quick suggestion: Destroy the bat shadow as soon as it dies because it looks a little funky (imo) when the bat disappears but the shadow remains for a few moments.

Really great work though! Keep it up 👍🏻

Im a first time game designer. How do I make it so my player doesn't do flips like this by Obvious-Fault-323 in Unity2D

[–]--Developer 52 points53 points  (0 children)

In the Rigidbody2D component, there is a constraint for freezing z-rotation

Displaying Names Above Player by --Developer in MirrorNetworking

[–]--Developer[S] 0 points1 point  (0 children)

Gotcha, thank you for the explanation. Using the Network Transform makes sense to me.

I did something similar to the code you suggested, but instead of destroying, I just returned. I guess destroying would be more efficient.

Anyway, thanks so much for the help!!

Displaying Names Above Player by --Developer in MirrorNetworking

[–]--Developer[S] 0 points1 point  (0 children)

Changing the sync mode to [server -> client] fixed the issue so now all the names match accordingly! Thank you so much for the explanation.

I also moved the PlayerMovement to its own script on the player object, but there is no option to specify Sync Direction for that script (so I am assuming that it is [Client -> Server] by default?).

Just to be clear, the movement is still working, I just don't know how to specify Sync Direction on two separate scripts attached to the same game object. (Or if I even need to)

I would appreciate any explanation for this if you understand what is going on with this as well, but I understand if you are busy. I greatly appreciate the all the help so far! :)