Hi,

I am using now the conditional prefabs for my Combatants in my game.

My settings are:
* Gameobjects: "bat_portrait" for the field mode and a battle prefab: "bat_battle" for turn-based battles.
* the conditional prefab is used when status "is in battle" = true
* When I lose a battle, I do not die forever and load a gameover scene, instead I revive the player's combatant and give him some HP again. And also the enemy is still at the position .

What I want to achieve:
* In the field mode the bat_portrait should be used --> works!
* When I interact with the object (through event) and start a battle, the "bat_battle" should be used --> works also!
* When battle is over, and I have lost, the bat_portrait should be used again for the enemy --> doesn't work!

I thought when battle is over, that the standard prefab is used again?
I also tried a 2nd conditional prefab which should trigger when status "is in battle" = false, but still, the combatant remains with the prefab/gameobject in battle state.

After battle the state of the combatant (component) is "in battle: no" (I looked in the inspector)

Is this a BUG or is there another way dealing with such situation?

Another question: Does ORK restore the replaced prefab somehow (let's say, that I add some components to the combatant during runtime --> are they gone after changing the prefabs?)

Thanks,
Dominik
  • edited April 2016
    Might be a bug - what's happening in your battle end event when the battle is lost?
    Alternatively, you can use a global variable marking a running battle and check for that condition, changing the variable in the battle start/end events. This would give you more control over the prefab replacement.

    ORK doesn't restore the replaced prefab, a new instance will be created each time the combatant's prefab is switched.
    Post edited by gamingislove on
    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!
  • Ok. If it makes a new instance, i will have to use my own implementation.

    :) thanks
Sign In or Register to comment.