Author Topic: Plugin bugs  (Read 153 times)

win20082007

  • Newbie
  • *
  • Posts: 4
    • View Profile
Plugin bugs
« on: June 01, 2020, 03:11:19 AM »
Hello, i have 2 bugs.
First when i try create load worlds from main menu. I have 2 scenes, one is MainMenu, and two is World scene was have VoxelPlayEnvironment. When i load save file in first - all works, but if i go back to main menu and try load scene again - load screen stopped in Loading World... step. After debugging i find reason. This is a coroutine DoWaitTime () in VoxelPlayEnvironment.Main. In cycle while is work once and stopped - but i dont understand why it stopped.

Second when i try destroy voxel in mobile plugin get me bug "Screen position out of view frustum", how i can fix it? (Look screenshot in attach).

Kronnect

  • Administrator
  • Hero Member
  • *****
  • Posts: 5832
    • View Profile
Re: Plugin bugs
« Reply #1 on: June 01, 2020, 10:57:15 AM »
Hi,

1) Are you using SceneManager.LoadScene() to load the game scene and also to get back to the main menu? That method works in our tests. If problem persists, please send a simple repro where scene is switched forth and back with your game and menu so we can investigate the issue.

2) Try the following change. Locate and edit VoxelPlayFirstPersonController.Crosshair.cs and in UpdateCrosshairScreenPosition add:

Code
        void UpdateCrosshairScreenPosition ()
        {
            if (freeMode) {
                Vector3 scrPos = input.screenPos;
                scrPos.x = Mathf.Clamp (scrPos.x, 0, Screen.width); // add this
                scrPos.y = Mathf.Clamp (scrPos.y, 0, Screen.height); // add this
                scrPos.z = 1f;
...

win20082007

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: Plugin bugs
« Reply #2 on: June 01, 2020, 11:40:51 AM »
1) Are you using SceneManager.LoadScene() to load the game scene and also to get back to the main menu? That method works in our tests. If problem persists, please send a simple repro where scene is switched forth and back with your game and menu so we can investigate the issue.
I am using SceneManager.LoadSceneAsync with LoadSceneMode.Single.

Kronnect

  • Administrator
  • Hero Member
  • *****
  • Posts: 5832
    • View Profile
Re: Plugin bugs
« Reply #3 on: June 01, 2020, 12:17:03 PM »
Trying to reproduce the issue, I've created a "MainMenu" scene which basically is empty except for script with:

Code
    void Update() {
        if (Input.GetMouseButtonDown(0)) {
            Debug.Log("Loading game...");
            SceneManager.LoadSceneAsync("World_Scene", LoadSceneMode.Single);
        }
    }

So, when clicking on the script, the World_Scene demo scene of Voxel Play loads.

And in World_Scene demo scene, I have a similar script but does the opposite: it loads the MainMenu scene again.

So far, it works fine on my end. Can you try using the same methods for loading scenes in a repro and send me the project?

win20082007

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: Plugin bugs
« Reply #4 on: June 01, 2020, 12:25:08 PM »
So, when clicking on the script, the World_Scene demo scene of Voxel Play loads.

And in World_Scene demo scene, I have a similar script but does the opposite: it loads the MainMenu scene again.

So far, it works fine on my end. Can you try using the same methods for loading scenes in a repro and send me the project?
You understand the problem wrong. I play my game from main menu, in him i can load world scene (one moment on load world scene saving is also being loaded). After that I can also go to the main menu, but i dont load world scene one more, its stuck in world loading step.

win20082007

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: Plugin bugs
« Reply #5 on: June 01, 2020, 02:41:04 PM »
I fix bug with load scenes (bug will be in my code), thanks for help. Second bug i will be test tomorrow.