|
Post by bender on Oct 5, 2019 18:32:40 GMT
I am trying to create/integrate a Pause Menu from which you can have many options to choose from. vInput captures all input unless you directly access your input through Input.GetKey(blah). This makes it fine for a simple "Pause the Game".
But how do I handle a menu system from which I want to accept mouse clicks?
Thanks
|
|
|
Post by Invector on Oct 7, 2019 13:34:07 GMT
Why don't you lock all the player input when the menu is open?
|
|
|
Post by bender on Oct 7, 2019 16:46:27 GMT
If I lock all the input I won't be able to receive events on my Pause menu. I would like my Pause menu to have options to Save, Modify Settings, Quit, etc.
I can hit Escape and bring up the menu but can't have any interaction with it.
|
|
|
Post by xianno on Oct 11, 2019 15:19:32 GMT
If I lock all the input I won't be able to receive events on my Pause menu. I would like my Pause menu to have options to Save, Modify Settings, Quit, etc.
I can hit Escape and bring up the menu but can't have any interaction with it
I would be very happy to know if you did find a way to do what you wanted; I'm at the same point since months, tried many ways, free and paid assets : nothing work
|
|
telgo
New vMember
Posts: 17
|
Post by telgo on Apr 7, 2020 16:15:41 GMT
I would like the same information.
|
|
|
Post by Invector on Apr 7, 2020 17:12:41 GMT
Guys, it's really not that hard... Access the ThirdPersonInput from your Menu script and once you open the Menu > tpInput.SetLockAllInput(true)
|
|
|
Post by xianno on Apr 15, 2020 13:44:52 GMT
Guys, it's really not that hard... Access the ThirdPersonInput from your Menu script and once you open the Menu > tpInput.SetLockAllInput(true) Yeah, blocking the character is easy. Making the UI respond to buttons entries is really hard as Cursor is unabled and can't properly be activated. I managed to make UI respond but cursor is still missing. I'm using keyboard to switch buttons and it's not fluid.
|
|
|
Post by Invector on Apr 15, 2020 14:30:58 GMT
Guys, it's really not that hard... Access the ThirdPersonInput from your Menu script and once you open the Menu > tpInput.SetLockAllInput(true) Yeah, blocking the character is easy. Making the UI respond to buttons entries is really hard as Cursor is unabled and can't properly be activated. I managed to make UI respond but cursor is still missing. I'm using keyboard to switch buttons and it's not fluid. You just need to unlock the cursor and show it as you press the button to open your custom menu. The methods are: tpInput.ShowCursor(true) tpInput.LockCursor(false)
|
|
|
Post by awpdesigns on May 17, 2020 12:36:30 GMT
Yeah, blocking the character is easy. Making the UI respond to buttons entries is really hard as Cursor is unabled and can't properly be activated. I managed to make UI respond but cursor is still missing. I'm using keyboard to switch buttons and it's not fluid. You just need to unlock the cursor and show it as you press the button to open your custom menu. The methods are: tpInput.ShowCursor(true) tpInput.LockCursor(false) [/quote] can you give me a simple tutorial to fix it? i am new with invector. thank you [/quote]
|
|
|
Post by sangman on Feb 14, 2021 18:12:46 GMT
I tried all these solutions but every time I am in the pause screen and mouse click a button, the cursor disappears and the function does not run. Just the pause screen shows with no cursor. Someone please help! Thanks.
|
|
|
Post by axbaby123 on Feb 14, 2021 19:08:04 GMT
Look at the game characters Inventory section in the Invector shooter&melee demos. Check out the Inventory Events on how to open, interact and close the Inventory. It acts similar to using Pause. Set it to revert back to normal after pause is closed as well.
ShowCursor
LockCursor
lock camera
lock player input timescale?
I add this to my Pause Game Event when I hit escape " tick" and when I close Pause I disable "no tick"
--for your Pause Open
() drag the vBasicController Prefab into the Runtime box and to the right choose vshootermelleInput Showcursor then tick the box () drag the vBasicController Prefab into the Runtime box and to the right choose vshootermelleInput Lockcursor then tick the box
--for your Pause Closed
() drag the vBasicController Prefab into the Runtime box and to the right choose vshootermelleInput Showcursor then Do Not tick the box () drag the vBasicController Prefab into the Runtime box and to the right choose vshootermelleInput Lockcursor then Do Not tick the box
|
|
|
Post by sangman on Feb 15, 2021 18:35:15 GMT
Awesome! Thank you so much!
So for newbees like me add simple UnityEvent (watch 3min video) and follow above:
using UnityEngine.Events;
public UnityEvent PauseEvents; public UnityEvent UnPauseEvents;
PauseEvents.Invoke(); UnPauseEvents.Invoke();
|
|
|
Post by max076 on Feb 22, 2021 12:50:39 GMT
Guys, can you upload screenshot what are you change in script to unlock cursor? Thank you!
|
|
|
Post by slapme on Jan 19, 2024 13:56:27 GMT
You just need to unlock the cursor and show it as you press the button to open your custom menu. The methods are: tpInput.ShowCursor(true) tpInput.LockCursor(false) can you give me a simple tutorial to fix it? i am new with invector. thank you [/quote][/quote] I cannot find either of these methods. Can you provide and example. I have this same issue. thx.
|
|
|
Post by axbaby123 on Jan 19, 2024 23:47:05 GMT
Drag the vBasicController Prefab into the Open Menu or whatever you onclick or Event system that you want the mouse to work. When you close the Menu or Ui then Do not tick the box so you can play the game without the mouse on screen. () drag the vBasicController Prefab into the Runtime box and to the right choose vThirdPersonInput Showcursor then tick the box () drag the vBasicController Prefab into the Runtime box and to the right choose vThirdPersonInput Lockcursor then tick the box --for your Pause Closed () drag the vBasicController Prefab into the Runtime box and to the right choose vThirdPersonInput Showcursor then Do Not tick the box () drag the vBasicController Prefab into the Runtime box and to the right choose vThirdPersonInput Lockcursor then Do Not tick the box
Below is an image of my Main Menu Pause system. You will see how I use the vBasicController or mellee or shooter to enable or disable showcursor or lock cursor. Note the Tick Boxes act as On or Off.
|
|