edited October 2015 in ORK Support
I'm still having trouble with this on mobile and on PC. I have a custom script I use on mobile for the First Person Player that handles both the movement joystick---arrow dpad on the left and circular joystick on the right to look around--

but it doesn't work on PC.

So--I made an arrow dpad using ORK Horizontal and Vertical inputs for a movement HUD for PC and that's fine. Can also use the arrow keys to move around on PC.

But my righthand joystick HUD which I made to rotate the camera so the player can look around still has problems. And trying to get it to work with unity input keys and the mouse is not getting me anywhere.

It doesn't move. My Player can't look around. If I increase the x sensitivity to 2 it moves and the player can look around but when I go through a teleporter or scene changer, it doesn't move at all. I'm stuck when I land in the new scene. I can move with the dpad but can't look around.

I have tried all sorts of workarounds for this but just lost right now. Any help is appreciated.

I'd really like to get the First Person look around functionality working on PC as for mobile I have as mentioned a script.

But a little lost on PC. Thanks.


Post edited by Catacomber on
  • edited October 2015
    I can by the way get looking around working using the mouse--but it's wonky. If I move the mouse to click on my hotbar, I look around while I'm trying to click on the hotbar--not good.

    I need to narrow the functionality down so I can have a righthand joystick on PC to look around if I use the joystick. : ) And no other movement happens. And no movement to look around happens unless I use that joystick. This is First Person.

    Or else if I use the mouse to look around, if I do other mouse clicks in the scene, I'm not looking around at the same time with my mouse.

    I don't know how better to describe my trouble. Thanks again for any help.

    I think part of my question is--First Person--whether I'm on PC or mobile--for the ability to look around horizontally with the camera---what input keys should I be using--I don't see any ORK input keys I can use--just horizontal and vertical---for looking around with the mouse or a joystick--

    so do I make new ORK input keys for looking around horizontally or use Unity keys for Mouse X and Mouse Y.

    Ideally I'd like just to look around with the mouse on PC but then that should not kick in when I'm clicking on another object in the scene with the mouse like my hotbar.

    Thanks!



    Post edited by Catacomber on
  • edited October 2015
    I'd recommend using a different control style on PC - I don't think anyone will play a (first person) game on PC where he has to use virtual controls with a mouse :)
    In many cases, mobile controls can't be transfered to PC controls without changes.

    Since you're using a custom script (?), that might not be suited for the regular PC first person control style (WASD to move and mouse to look). Also, when having mouse control for the camera, you should use input keys to fire your hotbar actions, i.e. use a Control Map to assign input keys to shortcut slots.
    Post edited by gamingislove on
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • This might be more than what you wanted to do, but if you're looking at porting stuff between platforms, I'd use a conditional compilation approach for your controls. (as described here)

    So basically, you stick all your stuff for mobile under the #if UNITY_IPHONE, and then all the stuff for PC under #if UNITY_STANDALONE_WIN (and on and on for other options as needed). Either copy and paste your custom script controls into their proper buckets, or add just add the corresponding controller script to your player prefab at game start (I don't really know your set-up more...so can't be more specific here. :/)
    My little chunk of the internet: http://artemic.com
  • for first person pc id recommend having the hot bar be set to keys i.e. 1,2,3 ect. also in your scripts its best to unlock the mouse and make visible the mouse cursor when menus are open ,and when close lock and hide mouse cursor this will stop movement of the camera when opening and closing the menus.... and allow the player to see the mouse when needed and not needed..
    new website can be found here http://www.fore-loregames.com

    Follow the game Development on Twitter https://twitter.com/Fore_Lore_Games

    or check out the face book page here https://www.facebook.com/ForeLoreGames
  • edited October 2015
    add this to a new c# name it what ever you want and delete the start and update
    make sure you still have the
    using unityengine; 
    using system.collections;
    public class what ever you named the script : monobehavior {


    add the code below goes here

    }
    public void lockcursor()
    {
    Cursor.lockState = CursorLockMode.Locked;
    Cursor.visible = false;


    }
    public void unlcokcusor() {

    Cursor.lockState = CursorLockMode.None;
    Cursor.visible = true;

    }




    and then make a event on open and close of the menu screens that calls these functions from ork


    side note: dont use touch pad controls on pc just use the regular wsad and mouse
    Post edited by wtyson on
    new website can be found here http://www.fore-loregames.com

    Follow the game Development on Twitter https://twitter.com/Fore_Lore_Games

    or check out the face book page here https://www.facebook.com/ForeLoreGames
  • Thanks for all the help. It's been so long since I "thought" PC or played a PC game, I forgot it would be necessary to use keys to play comfortably. Trying all your suggestions! :)

    Thanks very much for the help and link and code.
  • edited October 2015
    Thanks gil, Firrerreo and wtyson----So I got this working now. : ) I'm using the First Person Character Motor script and FPS Input Controller script which I don't think Unity uses any more but I like it for First Person and they still work and I know the ins and outs of the scripts.

    Using Unity input keys for Horizontal and Vertical and Mouse X and Mouse Y.

    I had already set up a Control Map with input keys for my attacks so the only thing I had to change there was to change it to use the keypad keys for input.

    I modified the FPS Input Controller script to add a Turn function so I could use the left and right arrows to turn.

    I modified the Mouse Look script so that it's restricted--you can use only the right mouse to look around but you can also use the left and right arrows to look around.

    Things seem to be working well.

    I think Tyson's two functions would be useful as a step in ORK for some scenes where you really don't want the player to be able to use the cursor in any way. : )

    Thanks to you all for all your help.

    @wtyson--how would I use the lock and unlock scripts in menus? I can use them in events but not sure how I'd add them in menus. Thanks. It would be a very useful feature.
    Post edited by Catacomber on
  • in menu screens theres a event spot for opening and closing menus so call one function in open and the other in another event for close
    new website can be found here http://www.fore-loregames.com

    Follow the game Development on Twitter https://twitter.com/Fore_Lore_Games

    or check out the face book page here https://www.facebook.com/ForeLoreGames
  • Thanks. I found it. :)
Sign In or Register to comment.