Topic: Programmatically Change Stance

I would like to change character stance programmatically when particular events occur. Can I do this in BattleGUI.cs?

Thanks

Share

Thumbs up Thumbs down

Re: Programmatically Change Stance

Yeah, you can do that.

Code example:

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);
        }
    }
}

Share

Thumbs up +1 Thumbs down

Re: Programmatically Change Stance

Thanks, do you know if the stance changes instantly, in the same frame?

Share

Thumbs up Thumbs down

Re: Programmatically Change Stance

I would imagine it does.

Share

Thumbs up Thumbs down