Attached weapons are using default weapon animations and projectiles

I’m running into an issue where, after the Lazy value currentWeapon and currentWeaponConfig are implemented, a picked up weapon uses the set default weapon’s animation and damage. For example, if i have the unarmed weapon config set as default, then if I pick up a bow, it uses the animation and stats for the unarmed weapon configuration. I followed this lecture step by step and can’t see where I’m going wrong. It changes the attached weapon appearance but not the behavior.
Changes to the fighter script:

Changes to the Spawn method:

For the weapon stats, it appears that in EquipWeapon, you’re not setting the currentWeaponConfig to the new WeaopnConfig.

public void EquipWeapon
{
     currentWeapon.value = AttachWeapon(weapon);
     currentWeaponConfig = weapon;
}

I’m not sure what’s happening with the Animator, that code looks correct. Make sure that the Bow AnimatorOverride controller is set in the Bow WeaponConfig (Note that sometimes during the conversion from Weapon to WeaponConfig, some properties are lost, like the AnimatorOverride, so it may have been set before the change and be null now).

it was the fact that i wasn’t setting the currentweaponconfig

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms