Hello guys, i have been trying to set the rotation for my combatant prefab view. The issue is that the prefab view portrait only shows the back of the combatant. I have tried setting the rotation on the y-axis of the rotation of the prefab view of the combatant portrait setting, but is not working(the rotation is never applied when the prefab is spawned). Any idea on how to fix this.

Please on a side note, how do i check the weapon a combatant is equipped with via code
  • I'll do some tests, but that should be pretty straight forward - is there anything special about your prefab's setup?

    You can access the equipment on a combatant like this:
    combatant.Equipment[partID].Equipment
    partID is the ID/index of the equipment part, Equipment gives you access to the equipped EquipShortcut class, which can be null (unequipped), a weapon or an armor.

    E.g. checking for a specific weapon:
    if(combatant.Equipment[partID].Equipment != null &&
    combatant.Equipment[partID].Equipment.IsType(EquipSet.Weapon) &&
    combatant.Equipment[partID].Equipment.ID == index)
    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!
  • @gamingislove thanks but still not working. The y-axis rotation is working as i expected. Please can you try it out
  • Can you give me some details on your setup?
    It's working on my end and the prefab is rotated as defined by the portrait's settings.

    Maybe there is some component attached to the prefab that's causing that? E.g. a player controller or something like 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.