edited February 2019 in ORK Scripting
My problem was that my player should be able to be moved by keys (W, S, A, D) or an on-screen arrowpad. I added the control for my player that moves him via the WSAD keys and that's fine.

However, in Game Play Mode, when i click on the on-screen arrowpad that should also move the player, nothing happened and my minimap didn't pick up the movement of my player.

I'm working through a solution for this by modifying the scripts. Movement script on player and script on arrow pad. If it doesn't work, I'll reask for help again.

Post edited by Catacomber on
  • edited February 2019
    This works perfectly for me now. I have a movement script on my player and on the arrowpad that is a graphic on the canvas I added two lines to its script.

    [RequireComponent (typeof (GameObject))]

    public GameObject Player;

    Slid the player prefab into that slot.

    Did the same to my minimap and all is well. Since my new passion is learning C# coding, this was very satisfying and, of course, happy that I can use these scripts to move my player in ORK. It took a lot of head-scratching as I've been away from Unity and ORK for awhile but it worked.

    Post edited by Catacomber on
  • There are also alternative solutions, e.g. using a Control HUD for virtual controls that directly set ORK input keys.
    You can also set ORK input keys via code, e.g.:
    ORK.InputKeys.Get(index).SetAxis(value);
    index is the ID/index of the input key, value the (float) value you want to set it to (e.g. 1 or -1).
    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!
  • Thanks very much, gil. I'll try this but how would I handle the button in the Control HUD to rotate 90 degrees left or right?
  • edited February 2019
    Through script. : ) I finally found that tutorial.

    Meanwhile, I combined the wasd movement keys script and OnGui script into one script attached to the player and everything so far is working smoothly, including smooth turning. Thanks. I'm self-taught when it comes to coding and I really suffered and head-scratched getting this to work but it was immensely satisfying when it did. I'm setting up an Eye of the Beholder type grid movement for my player and so far, so good.
    Post edited by Catacomber on
  • You know you can always ask for help here :)
    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!
Sign In or Register to comment.