Removing weapons in the hands of death

Support for MFPS 2.0
Post Reply
User avatar
Leonid_RU
Contributor
Contributor
Posts: 45
Joined: Tue Sep 11, 2018 3:04 am

Sun May 24, 2020 12:57 pm

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.
User avatar
Lovatto
Admin
Admin
Posts: 1493
Joined: Sun Dec 07, 2014 3:18 pm
Contact:

Tue May 26, 2020 2:38 pm

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.
User avatar
Leonid_RU
Contributor
Contributor
Posts: 45
Joined: Tue Sep 11, 2018 3:04 am

Fri May 29, 2020 11:50 pm

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.
User avatar
Lovatto
Admin
Admin
Posts: 1493
Joined: Sun Dec 07, 2014 3:18 pm
Contact:

Mon Jun 01, 2020 7:11 pm

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);
Post Reply