wizardpoop
Member
This link has helped in the past http://www.opsive.com/forum/index.p...r-in-air-ground-pound-ability.5410/post-26785, but I'm ultimately curious about the definitive and proper way to reset a UCC character. I ask as I just fixed another bug related to this and I'd like to be confident I've reset everything properly moving forward. For context I now have:
@Justin My question is, what specifically needs be cleared and/or reset in the UCC component? Do any other Opsive systems need to clear/reset too? If so which and how?
- A main UCC character that can launch/spawn other UCC characters from a pool
- When despawning a spawned UCC character I currently have the following:
C#:
// Despawn locomotion update
UltimateCharacterLocomotion ucc = source.GetComponent<UltimateCharacterLocomotion>();
ucc.Velocity = Vector3.zero;
ucc.GravityAmount = 0;
ucc.ResetRotationPosition();
if (ucc.Platform != null)
{
// This ensures subsequent Spawn's originate properly
ucc.SetPlatform(null);
}
// Stop all active abilities
foreach (var ability in ucc.Abilities) // ucc.ActiveAbilities vs. ucc.Abilities was resulted in a null ability during the loop
{
if (ability.IsActive)
{
ability.StopAbility(true);
}
}
@Justin My question is, what specifically needs be cleared and/or reset in the UCC component? Do any other Opsive systems need to clear/reset too? If so which and how?