Scenario is I have two player combatants

one of them is out of screen but his UI prebab (the one that have info about the health, mana) is on screen.

the combatant that is on screen has an ability that can target himself or other members of his group.

But other members of his group are not on screen.

How to make the UI prefab to also be the target for his respective combatant?

So I can select as target, either the combatant himself, or his HUD element that has info about him?

What could be the best path to do this? Moving camera is not an option
  • You can't do that - the HUD can't be used with a target prefab.

    An alternative would be to use a Fade HUD Color target highlight, e.g. blinking the HUD of the selected combatant.

    I'll look into adding new HUD conditions to e.g. show a cursor image on the HUD when the combatant is currently targeted.
    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 May 2023
    So the game is 2D

    Could this work if I add a second collider to the combatant that is positioned at the same position as the HUD?

    So the mouse thinks the combatant is there?

    I may try to enforce the collider position somehow when I animate the combatant in or out of the screen.

    Thinking of it this may be good to have even when selecting a portrait in the HUD

    if you add the cursor image to the HUD, this means we can also selecting that HUD piece, because else I don't think is useful. Useful for this situation I mean
    Post edited by dorusoftware on
  • Yeah, that could also work - or you can hide the combatants without disabling their game object and place them on screen. The Object Visible node can do that.
    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.