Page 1 of 1

Removing weapons in the hands of death

Posted: Sun May 24, 2020 12:57 pm
by Leonid_RU
Good afternoon!

Tell me how you can remove weapons from the hands of the player (not the bot) after his death. I tried to do it in various ways, but the weapon was still in my hands. The bots managed to remove the weapon without any problems.

Re: Removing weapons in the hands of death

Posted: Tue May 26, 2020 2:38 pm
by Lovatto
You mean to throw the weapon after the player dies so the weapon is able to pick up by other players, right?
if's so, this is already implemented, if this is not how works for you, please provide me some details to replicate the scenario.

Re: Removing weapons in the hands of death

Posted: Fri May 29, 2020 11:50 pm
by Leonid_RU
I need the weapon in the player's right hand to simply hide after death (SetActive (false) or Remove). I know about the weapon drop.

Re: Removing weapons in the hands of death

Posted: Mon Jun 01, 2020 7:11 pm
by Lovatto
In this case, the code that you should look at is located in bl_PlayerHealthManager.cs -> Die(...) ->

Code: Select all

 if (bl_GameData.Instance.DropGunOnDeath)
            {
                GunManager.ThrwoCurrent(true, PlayerSync.NetGunsRoot.position + transform.forward);
            }
replace that call with a simple:

Code: Select all

PlayerSync.NetGunsRoot.gameObject.SetActive(false);