News Forums Sentio Characters General Discussion and Troubleshooting GotHit animation doesn't play

This topic contains 4 replies, has 3 voices, and was last updated by  QUEdotCOM 2 weeks, 4 days ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #39888

    radiant
    Participant

    I’m using UFPS, Sentio and the Minotaur, I can shoot and hurt him, and kill him, but he doesnt ever play the animation that shows that he got hit, I can’t figure out why that is? Any Ideas?

    #39889

    Sigil
    Keymaster

    He does play his death animation though yea?

    #39891

    radiant
    Participant

    Yes that works fine.

    #39892

    Sigil
    Keymaster

    OK, well I traced through the code and the behavior tree on the Minotaur and playing his GotHit animation revolves around the damageReceived variable.

    So perhaps the first thing to determine is if that variable is getting set. The easiest thing would probably be to attach a debugger and set a breakpoint in the AIDamageReceiver. If you haven’t done that before I can run you through it.

    If you want to skip the debugger, you could just add a Debug.Log statement in Sentio/Minotaur/Components/AIDamageReceiver:

    ...
    public override void Update()
    {
        if (HealthElement != null)
        {
            MaxHealth = HealthElement.MaxHealth;
            MinHealth = HealthElement.MinHealth;
            CurrentHealth = HealthElement.CurrentHealth;
        }
        CurrentHealth = Mathf.Min(MaxHealth, Mathf.Max(MinHealth, CurrentHealth - CurrentDamage));
        if (HealthElement != null)
        {
            HealthElement.CurrentHealth = CurrentHealth;
            if (CurrentDamage > 0)
            {
                // Right here
                Debug.Log("Took Damage " + CurrentDamage);
                HealthElement.AI.WorkingMemory.SetItem<bool>("damageReceived", true);
                HealthElement.AI.WorkingMemory.SetItem<bool>("healingReceived", false);
                HealthElement.AI.WorkingMemory.SetItem<float>("damageAmount", CurrentDamage);
                HealthElement.AI.WorkingMemory.SetItem<float>("healingAmount", 0f);
            }
    ...

    So if that debug message is getting output (or the breakpoint is getting hit), then the problem has to be in the behavior tree, which means we’ll have to go to the behavior tree debugger to see what is happening. We’ll try that if the above is working properly.

    #39909

    QUEdotCOM
    Participant

    I will try it to my project.

    And will update soon.

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.