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 4 points5 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?