Stamina decrease while sprinting

Shadowing

Member
Can't seem to get this ability Sprint to use Stamina Latest Version UUC2
Also Setting Stamina to value 100 makes it start at 0 for some reason. Stamina does increase to 100 during Run time. It just doesn't decrease when Sprint is active





 
Last edited:
Thanks, I didn't know how to do this - you helped me !
Then is there a nice way to access and set the attributes by script ?
 
@discofever Yes it's really not complicated, you just need to get Attribute Manager you need, then from it the Attribute that you want to modify, here's a very basic example :

C#:
using Opsive.UltimateCharacterController.Traits;
using UnityEngine;

public class AttributeScript : MonoBehaviour
{
    public AttributeManager attributeManager;
    public string attributeName;
    Attribute attribute;
    private void Start()
    {
        attribute = attributeManager.GetAttribute(attributeName);
        attribute.Value = 45;
        attribute.AutoUpdateValueType = Attribute.AutoUpdateValue.Decrease;
    }
}

So for example if you attach this to the demo character and write Health as the attributeName, it will automatically lower the health value to 45 and make it decrease over time.
 
Top