Re: Stance change triggered by life.
You can achieve this by using the OnLifePointsChange event, then accessing the stance change function like this:
using UnityEngine;
using UFE3D;
public class ChangeStance : MonoBehaviour
{
private bool rageMode;
private void Start()
{
UFE.OnLifePointsChange += this.OnLifePointsChange;
}
void OnLifePointsChange(float newLifePoints, ControlsScript player)
{
if (!rageMode && player.currentLifePoints <= 20)
{
rageMode = true;
player.MoveSet.ChangeMoveStances(CombatStances.Stance2);
}
}
}
For more on coding events check out this page:
http://www.ufe3d.com/doku.php/code#global_events
Questions about the Forum? Check out our Karma FAQ.
Re: Stance change triggered by life.
You can achieve this by using the OnLifePointsChange event, then accessing the stance change function like this:
using UnityEngine; using UFE3D; public class ChangeStance : MonoBehaviour { private bool rageMode; private void Start() { UFE.OnLifePointsChange += this.OnLifePointsChange; } void OnLifePointsChange(float newLifePoints, ControlsScript player) { if (!rageMode && player.currentLifePoints <= 20) { rageMode = true; player.MoveSet.ChangeMoveStances(CombatStances.Stance2); } } }
For more on coding events check out this page:
http://www.ufe3d.com/doku.php/code#global_events
Interesting, this script should be added directly to the character?
Re: Stance change triggered by life.
I think you could add that directly to the scene.
It looks like that script might also effect both players.