[SOLVED] Show/Hide mouse on ESC for menu
Re: Show/Hide mouse on ESC for menu
The Dialogue System's example scenes don't do anything with the cursor. They just leave the cursor untouched (visible) the whole time.
Are you using your HideLockMouse script and the pause menu at the same time? They'll step on each others' toes. As a test, try removing HideLockMouse and anything else that controls the cursor except for the UI/pause menu. Then test it out. Don't engage in a conversation yet. Let's make sure everything is working perfectly in the editor and a build before bringing conversations into the mix.
If it's still not behaving, can you put together an example reproduction project and send it to tony (at) pixelcrushers.com?
Are you using your HideLockMouse script and the pause menu at the same time? They'll step on each others' toes. As a test, try removing HideLockMouse and anything else that controls the cursor except for the UI/pause menu. Then test it out. Don't engage in a conversation yet. Let's make sure everything is working perfectly in the editor and a build before bringing conversations into the mix.
If it's still not behaving, can you put together an example reproduction project and send it to tony (at) pixelcrushers.com?
- supadupa64
- Posts: 200
- Joined: Sun Mar 06, 2016 9:40 pm
- Contact:
Re: Show/Hide mouse on ESC for menu
If I just use the ui by itself and nothing else, the cursor shows the whole time. I don't know if it matters, but I've never been able to pull up the menu or pause menu in my main scene editor play. Maybe that's because my menu and pause menu ui are in a different scene hierarchy?
Actually never mind, I played in editor mode from my ui scene and clicked start to enter my other scene and I can now pull up the pause menu. Nice, this should be a lot faster than making a build every time.
Actually never mind, I played in editor mode from my ui scene and clicked start to enter my other scene and I can now pull up the pause menu. Nice, this should be a lot faster than making a build every time.
Game I'm working on:
Website: http://www.RuctionGames.com
Steam: http://store.steampowered.com/app/49682 ... en_Tablet/
Website: http://www.RuctionGames.com
Steam: http://store.steampowered.com/app/49682 ... en_Tablet/
Re: Show/Hide mouse on ESC for menu
Great! What happening with the cursor now?supadupa64 wrote:If I just use the ui by itself and nothing else, the cursor shows the whole time. I don't know if it matters, but I've never been able to pull up the menu or pause menu in my main scene editor play. Maybe that's because my menu and pause menu ui are in a different scene hierarchy?
Actually never mind, I played in editor mode from my ui scene and clicked start to enter my other scene and I can now pull up the pause menu. Nice, this should be a lot faster than making a build every time.
- supadupa64
- Posts: 200
- Joined: Sun Mar 06, 2016 9:40 pm
- Contact:
Re: Show/Hide mouse on ESC for menu
Actually the same thing as at first. Everything works except if I hit ESC a second time the cursor shows indefinitely. The cursor functions perfect if I select "leave" or "close" or "resume," but if I try to cancel the UI or a dialogue using ESC, it shows the cursor forever.
Game I'm working on:
Website: http://www.RuctionGames.com
Steam: http://store.steampowered.com/app/49682 ... en_Tablet/
Website: http://www.RuctionGames.com
Steam: http://store.steampowered.com/app/49682 ... en_Tablet/
Re: Show/Hide mouse on ESC for menu
Did you try removing HideLockMouse before playing?
I'll try reproducing this later today with the menu template prefab and TPC.
I'll try reproducing this later today with the menu template prefab and TPC.
- supadupa64
- Posts: 200
- Joined: Sun Mar 06, 2016 9:40 pm
- Contact:
Re: Show/Hide mouse on ESC for menu
Yeah I've tried it a lot of times, quite a few different ways. The solution has to be close... I disabled the TPC, but then it's kind pointless since I need it to disable cursor in game anyhow, and the menu isn't doing it. I really appreciate the help.
Game I'm working on:
Website: http://www.RuctionGames.com
Steam: http://store.steampowered.com/app/49682 ... en_Tablet/
Website: http://www.RuctionGames.com
Steam: http://store.steampowered.com/app/49682 ... en_Tablet/
Re: Show/Hide mouse on ESC for menu
Okay, I'll try to reproduce it here. If possible, please put together a reproduction project and send it to me. Otherwise I'll just use the vanilla TPC and menu template setups.
Re: Show/Hide mouse on ESC for menu
It's Third Person Controller. When you press Escape, it always show the cursor. For the next release, I'll ask Justin to add a way to disable this functionality. In the meantime, import the TPC source code. Then edit UnityInput.cs and change line 161 from this:
to this:
Code: Select all
if (UnityEngine.Input.GetKeyDown(KeyCode.Escape)) {
Code: Select all
if (false && UnityEngine.Input.GetKeyDown(KeyCode.Escape)) {
- supadupa64
- Posts: 200
- Joined: Sun Mar 06, 2016 9:40 pm
- Contact:
Re: Show/Hide mouse on ESC for menu
That did work, however, I now have thousands of errors and tons of lag. I changed it all back in the meantime.
Game I'm working on:
Website: http://www.RuctionGames.com
Steam: http://store.steampowered.com/app/49682 ... en_Tablet/
Website: http://www.RuctionGames.com
Steam: http://store.steampowered.com/app/49682 ... en_Tablet/
Re: Show/Hide mouse on ESC for menu
Justin's putting the change in TPC 1.3.
Regarding the errors and lag, did you remember to remove the Scripts folder before importing the source package?
Regarding the errors and lag, did you remember to remove the Scripts folder before importing the source package?