You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
NullReferenceException: Object reference not set to an instance of an object
PlayerShoot.Update () (at Assets/Scripts/PlayerShoot.cs:32)
This happens once a second player enters the network. The line that gives the error is:
if (currentWeapon.fireRate <= 0f)
{
if (Input.GetButtonDown("Fire1"))
{
Shoot();
}
After Debugging - it seems that currenWeapon is assigned when the host is playing in the server - but as soon as a second client joins, this reference gets broken. Any ideas?
Hi,
I'm getting an error:
NullReferenceException: Object reference not set to an instance of an object
PlayerShoot.Update () (at Assets/Scripts/PlayerShoot.cs:32)
This happens once a second player enters the network. The line that gives the error is:
After Debugging - it seems that currenWeapon is assigned when the host is playing in the server - but as soon as a second client joins, this reference gets broken. Any ideas?
Here is my PlayerShoot Script: https://www.codepile.net/pile/BNWvbZRM
Here is my WeaponManager Script: https://www.codepile.net/pile/d3orgj1D
Here is my PlayerWeapon Script: https://www.codepile.net/pile/L8m56W8J
The text was updated successfully, but these errors were encountered: