Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

E.13 (Muzzle Flash) #42

Open
DoodyDan opened this issue Sep 30, 2021 · 0 comments
Open

E.13 (Muzzle Flash) #42

DoodyDan opened this issue Sep 30, 2021 · 0 comments

Comments

@DoodyDan
Copy link

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:

    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?

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant