Problem with WeaponPickUp

After doing this part, I’ve noticed that my Enemy 101 also is equipped with the weapon, that the player is picking up. Can’t seem to find out why.

Did you manage to solve the problem?

I am about to dive in now, as I have come to find the same bug - and I have some notion to what might be the issue.

We are just finding an object of type Weapon System in the code basis of the Weapon Pick Up, maybe we ought to be more specific than that.

I can post my solution when I figure out a fix. Great job if you got it done already!

EDIT!!

I tried only picking up the weapon if it was the player who activated the trigger, but with little to no effect.

I then tried to dig into the Put Weapon In Hand method in the Weapon System class. Alas, to no avail.

I finally removed the Weapon System script component from the Player to just put it back on him, and that seemed to do the trick. I then created an NPC template like we did the enemy and gave him a Weapon System component too, then he was the one getting the weapon pickup. So it seems the last character to get the component gets to have the weapon.

Couldn’t find the reason behind though. It may be a bug in the code, with Unity 2017 or we might miss something. I don’t know, but they will probably squash it, if it is a bug, at some point.

Privacy & Terms