edited April 2023 in ORK Support
I'm following the 2D tutorial and got till point 16 of battle system. All appears to work fine, battles starts, I can select the menus, attack, get attacked. But the Mouse select on the enemy doesn't work like in the finished example.

I'm using my own sprites for player and enemy (static pngs) I've triple checked all the places that appears to be involved with the mouse selection taking the working completed project as reference:

enemies (I spawn multiple enemies) are sprite renders with Box Collider 2D component and have the "Is Trigger" checked. they have the Combatants layer set. when running the game they are at 0 on z axis

in Target Settings (Battles tab) Mouse Touch control is set to Combatants layer mask, distance 100. Input type set to both.

What I'm missing? Why I can't select the enemy with the mouse, but only select them via the names that appear in the menu? What option I'm missing?

Mouse works in the battle menu, if this maybe was not clear
Post edited by dorusoftware on
  • The tutorial limited that to the layer Combatants, so make sure your combatants (prefabs) are placed on that layer.
    Also, they need a collider (2D) attached, or there's nothing that can be clicked.
    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!
  • edited April 2023
    all appear to be set correctly, here are some screenshots

    image

    image

    image

    I'm not sure what is going on but I've continued the tutorial and the HUD doesn't show up also. I've even copy pasted the HUD prefabs from the working project, maybe I've messed something when creating my prefabs, nope. they don't show up. The HUD layer in game doesn't have anything attached to it.

    maybe there is any way to turn up logs or similar to see if there is anything wrong?

    unity version is 2021.3.22f1, but the completed project I've downloaded works on this version also so I don't know

    makinom 2.12 and ork framework 3.13

    some additional info is that is an URP 2D project
    Post edited by dorusoftware on
  • edited April 2023
    ok good news and also veeery strange, it works now, both the click and the HUD but I don't know why

    so after writing the part about URP I've got this doubt.

    in my project I have one scene that starts the game, initialize the framework, then it start a battle (which loads a new battle scene like in the tutorial)

    when I've created this main scene I think I've used either the empty scene or the 2D Basic scene or maybe the default scene that unity creates the first time.

    I've just created a new 2D scene but using the Lit 2D Urp option. and I've copied the objects from the previous scene. the game starter spawn points, all except the camera and the light.

    hit play and it WORKS, mouse click works and the HUD works.

    good news is that it works but why I don't know
    Post edited by dorusoftware on
  • the same identical setup still doesn't work in the old scene. this is why I really dislike unity. stuff like this that takes days to fix and when you fix it you don't even know what is going on.

    you should think on porting this ork framework on unreal, if is not already available there yet
  • My best guess is that there's something in the scene blocking the click.
    Either something in the scene itself or e.g. the player combatant's collider being too big? UI can also block clicks.
    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!
  • the content in the scene is exactly the same as the one that works. all the setup I've learned from the tutorial works perfectly inside the new scene, but doesn't work in the other scene.

    I think ork fails to do something because the HUD also doesn't show up. is not only the mouse click over the enemy

    also there is only one battle scene.

    ok so hear this.

    oldscene initiate battle loading a battle scene (HUD doesn't work, click doesn't work)

    newscene initiate battle, loads the SAME battle scene as the above, (now HUD works and click works)

    I've made a diagram so this is clear.

    image

    If you want I can send you the project, there is nothing inside apart three prefabs and a couple of sprites.
  • Is the game starter in the scene set to Start Game?
    Otherwise, do you get an error when starting in that scene?
    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!
  • the scene that works is exactly the same like the scene that doesn't work.
    but I think probably that scene is corrupted somehow. maybe some weird glitch by unity.

    important that it works in the other scene. fortunately we don't need to care about it anymore :) hopefully it will not show up anymore.
Sign In or Register to comment.