PlaceholderGames / Gluten-Free-Waffles

Team 2 CS2S561 game
0 stars 2 forks source link

Bug with Pausing and Resuming the Game #37

Closed WilliamAkins closed 6 years ago

WilliamAkins commented 6 years ago

When you pause the game and then resume it, you can no longer interact with any in game items with either the keyboard or mouse, also when you hover the crosshair over the items no UI popup shows.

Another but rather minor issue is that the crosshair will appear above the pause menu when it's shown. I'm not sure whether this is an issue with the pause menu or the crosshair.

As you designed the pause menu would you like to have a go at solving this issue @JakedPotato ?

GreggsNBacon commented 6 years ago

Issue is fixed with this code replacing the code for the raycast in playerGUI. Will update later: Ray checkForItem = transform.GetChild(1).GetComponent<Camera>().ViewportPointToRay(new Vector3(0.5f, 0.5f, 0));

Also the UI camera needs to have the cam mouse look script removed and have it replaced with SetRotation and have the mainCamera variable be set to the FPP camera.

Issue was: Both cameras were set as the main camera. Beyond that, I've got no clue why the bug was fixed by those slight changes.

NOTE: The changes did not work if one of them is ignored. All those changes must be applied for the fix to occur.