I have a HUD Navigation bar set with navigation points for interaction machines used for quest givers.
https://imgur.com/a/B72Pza9My Navigation Point Prefab is unchanged from the prebuilt one Nav Point (for prefabs).
My quest givers show a UI HUD over their heads depending on the state of the quest. Is there a way to access the combatant the navigation point is attached to? And then assign a sprite to the navigation point via code?
I.e. you can use a HUD Condition component to do checks on it, e.g. enabling/disabling child objects with different sprites based on variable conditions or status conditions of the combatant they display (if the interaction's game object is also a combatant, otherwise just variable conditions, e.g. via object variable components).
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
For checking the variables themselves, I should use Game Object of user in the HUD Condition components?
Finally, if I can show the underlining point prefab sprites, will I need to add separate UI Content components to the root of the point prefab to show the image child objects for each state? Or is there a way to get the sprite of the UI Content to select whichever is enabled?
https://imgur.com/a/9rGcYbz
You simply define the different sprites as regular Image components. I.e. each sprite is it's own child object of the prefab. You can use the HUD Condition (or e.g. a Game Object Manager component to enable/disable the sprites as needed.
The UI Content setup is used for displaying content that's coming from the HUD's content/user. For your needs to show sprites based on some condition, you simply need to use regular sprites that you set up in the prefab.
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
https://imgur.com/a/aDjEFYs
In those screen shots I show the Game Object Manager component's check and the second screenshot is the "user" with the child object containing the Object Variables component.
I am attempting to write a script to test but I am unsure how to convert the object user to a GameObject or Combatant so I can use GetComponent.
I'll look into it.
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!