edited April 2016 in ORK Support
Hey there,

I've been having some trouble for a while now trying to figure out how to use the mouse to select targets during a combat. The battle is working and I can use the arrow keys or the menu (if I have it enabled) to select targets, but clicking on the targets does nothing and no input is accepted unless I scroll with mouse keys and then hit enter.

I believe it is all set up correctly - in Battle System -> Battle Settings -> Target Selection I have:
http://puu.sh/oh821/b548f490f1.png

Then I also did the following under Battle System -> Battle Settings -> Individual Target Selection:
http://puu.sh/oh88s/a7119e6fa9.png

Thanks for any help.. I can't seem to figure this out. Should there be a component to put on my combatants? I've tried UIMouseOverComponent and UIChoiceButtonComponent, but neither worked.
Post edited by deckrocket on
  • Just bumping this up a bit in case anybody has any ideas - I still haven't been able to solve this, but using keys/selecting menu options is working good enough for now while I work on other stuff.
  • For using the cursor where you have the prefab set up for it, try setting Y offset to 1 and in On Child type in Head. I got this to work before I started using mobile. I think it works in the ORK Demo. Maybe you need to tweak some other settings but I'd start there.
  • So what I've done is use this tutorial ( http://orkframework.com/tutorial/game-tutorial/16-battle-prep/ ) and this particular step:
    http://puu.sh/omZcA/db221e9394.png

    So my settings are as shown: http://puu.sh/oh821/b548f490f1.png

    My target selection is similar to what you've mentioned ( http://puu.sh/omZkn/f709a5d1c5.png ), except I don't have any child game objects (so I've left it blank) and my cursor prefab is set up so that it already has a fairly large and offset collider ( http://puu.sh/omZpH/daeb8a86a8.jpg ).

    Anyways, thanks for your reply. I'm still stumped :(
  • edited April 2016
    Well your reply definitely sparked my memory. I decided to try copying the prefab from the tutorial and that worked.

    I guess the problem was the fact that I had been using a 2D Box Collider as my game is in 2D. Once I changed it to a 3D Box Collider (from the tutorial prefab) it worked.

    So - excellent! However, now I can only select the first enemy with the mouse, clicking/hovering over the others doesn't make them the "active" target. Know how to fix this?

    I'll keep doing some searching on my own! Thank you for the spark!
    Post edited by deckrocket on
  • Hi GiL,

    Now that you are back from a well deserved holiday maybe you can help me with this issue?

    I still seem unable to use the mouse to hover over and select different enemies during a combat.

    Thanks!
  • edited April 2016
    Check the Raycast Type in Game > Game Settings when using 2D colliders. This setting handles which raycasts will be used - 3D, 2D or both.

    If clicking on an enemy doesn't select it, make sure it has a collider and there is no collider between the camera and the object that could block the click (e.g. by setting those objects to the Ignore Raycast layer).

    You can't select targets by hovering the mouse over them, only by clicking.
    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!
  • Is it possible to make the cursor move to the object I'm hovering over, or is that the same as selecting?

    If not, I will just write a separate script that will move my own cursor prefab for me.

    Thanks though - that Raycast being set to 3D only was exactly the problem!
  • ORK's target selection cursor just displays a cursor prefab over a selected combatant (e.g. when selecting it in the target menu). There's no moving a cursor around in the scene, so you'd have to add that yourself, e.g. through custom scripting, the event system or other products like Makinom.
    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.