1

I want to make a 1st person game and the whole problem started by making an accessible inventory. Whenever I used mouse.locked (no matter if i do mouse.locked = True or mouse.locked = False) (it basically makes possible to move the cursor around the screen, not to look around), black screen started flickering over the game window. Any ideas how to fix that?

Code:

          from ursina import *
          from ursina.prefabs.first_person_controller import FirstPersonController
          if inventory.visible == True:
                player.speed = 0
                player.jump_height = 0
                grid.visible = True
                mouse.locked = False #If I put this here, black screen starts flickering. Pls help...
                testitem.visible = True
    

Dave J
  • 19
  • 6
  • Please make sure to provide all the necessary information for the question to be answerable up front. Offering the "full code", etc, upon request is not allowed on this site. – cigien Oct 24 '22 at 05:02
  • @cigien Ok, click [here](https://pastebin.com/qBbUS7YS) then... – Dave J Oct 26 '22 at 13:28
  • No, a link to a pastebin is not acceptable either. Please include the information as formatted text into the body of the question itself. – cigien Oct 26 '22 at 13:30
  • @cigien ok, but the problem is in the `mouse.locked` itself and i need to fix that... – Dave J Oct 27 '22 at 10:25

1 Answers1

1

Maybe it's a bit late, but... I had the problem too. For me it solved the problem by closing all other apps (also background). If MS Teams was opened it flickered. Ursina wasn't the reason.

someone
  • 65
  • 6