10/7/2023 0 Comments How to make diablo 3 wasd script not mouse cursor go to the ceneter of screen ownedcore forumsIn essence, I trigger the OnSelect event on PointerEnter, and trigger OnDeselect on PointerExit on every Selectable, and when on switching to directional input (detecting WASD/arrows/dpad etc), I clamp the mouse's movement area to go around the limitation that you cannot move the mouse pointer because it's handled by the OS.What is the point in giving us WASD movement, if there is no dedicated attack key? The only way to have attack without movement is by holding shift, which prevents you from moving entirely. I have a script that sets which button is this "first to be selected" button on every screen.when switching from directional to cursor, just lose all selection because chances are your mouse is not already hovered on anything anyway.when switching from cursor to directional, if something was selected, I want navigation to continue from there (ie if you have the 3th button selected, I want to select button 2 if I pressed UP).when switching from cursor to directional, if nothing was selected, I want the first button on the screen selected*.I'd like users to have the ability to switch between using mouse, keyboard and gamepad controls, and in turn, seamlessly switch between navigating via mouse cursor and directional (WASD/Dpad). I searched for a solution but found none that worked for me, so I'm posting my findings here in case anyone stumbles on this in the future with a similar problem: It looks confusing and because a highligted button doesnt set the currentSelectedGameObject in the event system, I cant easily remove the "leftover" highlight in a straightforward manner. This means that if you are mousing over a button and press a directional button, you'll end up with one button being HIGHLIGHTED (mouse) and another being SELECTED (directional), so it looks like you have two buttons "selected", but when you press submit, the SELECTED button gets submitted. I am not sure why, but Unity treats a selectable (ie a button) being selected by directional navigation (ie WASD) and being selected by mousing over the selectable differently, as two separate states.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |