Hello, I hope that all is well.

I seem to have some trouble with my combatant and an equipment’s conditional prefab.
I have a male and female version of a chestplate

The equipment is setup to have the male chestplate by default and the female as conditional prefab. I’ve given the female combatant the object variable change: variable key “Female” and Bool Value = “True” (I’ve tried local, I’ve also tried object, local list, etc.)

During play mode I can see in the inspector that the variables are working properly but for some reason the equipment’s conditional prefab’s conditions aren’t working. For these I have the following for the equipment’s conditional prefab’s condition: Variable Key: “Female” – Origin: “Local” Is Valid = “True” I’ve also tried: Variable key “Female” origin: “Object” – Game object “User – is Valid =”True” I’ve tried all the scopes with root and without it.

Yet for some reason the equipment’s conditional prefab does not show when equipped on a female combatant. The male version does show (but that’s not the intention.) ** And Yes, I did try the female chestplate conditional prefab without any variable conditions and the male does wear the female chestplate.

I’ve looked at the inspector of the female combatant in play mode, and all the variables are there on the parent object, showing the object variable component and the bool variable “Female” = “True” being active. But to no avail.

Is there something I might be missing or is doing incorrectly?

I’ve used the variables condition plenty of times before on various other things and it worked just fine but for some reason, it doesn’t seem to be working for me with the equipment’s conditional prefab’s variables conditions.

Any help is appreciated, many thanks in advance!

EP
  • Did a quick test and seems to be working fine on my end. I have a bool variable on the combatant and the conditional prefab using variable origin Object and object User.

    Make sure you use the correct setting for the prefab - i.e. the Viewer Prefab of the conditional prefab is used for the equipment viewer. There are many similarly named settings, so make sure to use that one.
    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!
  • Hi GIL thanks for your reply.

    Yes, I’ve doubled checked what you’ve mentioned above and everything seems in order.

    I forgot to mention that when it comes to testing 1 combatant only, it works for me too. But when you add an additional combatant to the player’s party, and that combatant is of opposite gender with the same chestplate equipped, that where the problem begins. They both have the male chestplate or female chestplate prefab.

    It seems to only take into consideration the first combatant’s object variable of the group and apply it to the rest of the combatants, while each combatant has their own object variable.
  • Hm, yeah, that seems to be a bug - will fix it in the next update.
    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!
  • Sounds good, thank you GIL! Much appreciated.
Sign In or Register to comment.