GreedyVox
Active member
Help wanted with throwing Grenades.
We don’t think this is a bug but most likely a set-up issue, we have runtime pickups for all our weapons and everything is working, however when we pickup a Grenado, the very first throw working as designed, but when we tried to throw again, the Grenado is stuck in the players hand and blows up killing the player and all those close by, throwing a null exception for the global variable m_InstantiatedThrownObject, in the ThrowableItem.cs from the public function ThrowItem ().
EXAMPLE
ABILITY
FIX
Adding this null checker to the script, just before the line m_InstantiatedThrownObject.transform.parent = null, fixes the error exception and everything working, no more Grenado blowing up in the players hand.
We have gone through all settings and cannot find what is wrong, this also happens in both single and multi-player tests, and it does feel like we are missing a settings somewhere, have also noticed that this function is called twice throwing exception on the second pass, but that's the problem, this function is being called twice.
We don’t think this is a bug but most likely a set-up issue, we have runtime pickups for all our weapons and everything is working, however when we pickup a Grenado, the very first throw working as designed, but when we tried to throw again, the Grenado is stuck in the players hand and blows up killing the player and all those close by, throwing a null exception for the global variable m_InstantiatedThrownObject, in the ThrowableItem.cs from the public function ThrowItem ().
EXAMPLE
ABILITY
FIX
Code:
if (m_InstantiatedThrownObject == null) {
Debug.Log ($"<color=blue>Grenado is thrown? [{m_Thrown}]</color>");
return;
}
m_InstantiatedThrownObject.transform.parent = null;
Adding this null checker to the script, just before the line m_InstantiatedThrownObject.transform.parent = null, fixes the error exception and everything working, no more Grenado blowing up in the players hand.
We have gone through all settings and cannot find what is wrong, this also happens in both single and multi-player tests, and it does feel like we are missing a settings somewhere, have also noticed that this function is called twice throwing exception on the second pass, but that's the problem, this function is being called twice.
Last edited: