This specific chain of events is causing Bug using UCC/BD in unity 2018.3.f1.
Bug description: Navmesh agent gets stuck to enemy they kill and retrieve item from, after activating ability.
This specific sequence of events produces the bug:
1. Enemy dies drops an Item Pickup
2. Player picks up the item
3. Ability is automatically activated due to item being acquired (see below for code)
4. Player seeks new destination (BD Seek)
The agent gets stuck here, standing over the enemy they just killed.
BD thinks the agent is moving towards its new agent. The agent agent is actually moving towards the transform of the enemy they just killed. If I manually drag the enemy in the viewport to where the agent is supposed to go, the agent follows and the task completes.
Why would agent be getting stuck to the corpse that it just picked an item off?
To make matters more confusing, the issue depends on the automatic activating of the ability (step 3.). If i turn off the ability, the character is able to pick up the item from the enemy and move onward - no problem.
The ability is extremely simple, it looks like this:
thankyou
Bug description: Navmesh agent gets stuck to enemy they kill and retrieve item from, after activating ability.
This specific sequence of events produces the bug:
1. Enemy dies drops an Item Pickup
2. Player picks up the item
3. Ability is automatically activated due to item being acquired (see below for code)
4. Player seeks new destination (BD Seek)
The agent gets stuck here, standing over the enemy they just killed.
BD thinks the agent is moving towards its new agent. The agent agent is actually moving towards the transform of the enemy they just killed. If I manually drag the enemy in the viewport to where the agent is supposed to go, the agent follows and the task completes.
Why would agent be getting stuck to the corpse that it just picked an item off?
To make matters more confusing, the issue depends on the automatic activating of the ability (step 3.). If i turn off the ability, the character is able to pick up the item from the enemy and move onward - no problem.
The ability is extremely simple, it looks like this:
Code:
public override bool IsConcurrent => true;
// Start is called before the first frame update
public override bool CanStartAbility()
{
var inventory = GetComponent<Inventory>();
if (inventory == null) return false;
foreach (var item in inventory.GetAllItems())
{
if (item.name == "Trauma") return true;
}
return false;
}
protected override void AbilityStarted()
{
GetComponent<Animator>().SetBool("Traumatized", true);
base.AbilityStarted();
}
protected override void AbilityStopped(bool force)
{
GetComponent<Animator>().SetBool("Traumatized", false);
base.AbilityStopped(force);
}
thankyou
Last edited: