fix: TanksCoop example, reset host values. (#3660)

Added OnStopServer  - nulls, to prevent a bug that can be caused on client host, when scenes do not reset during play, tank variables are set as "missing", which Unity does not count as null/empty.
This commit is contained in:
JesusLuvsYooh 2023-11-22 20:32:51 +00:00 committed by GitHub
parent a420e20d24
commit d55967640f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -97,5 +97,13 @@ void OnOwnerChangedHook(NetworkIdentity _old, NetworkIdentity _new)
}
}
public override void OnStopServer()
{
// To prevent a bug that can be caused on client host, when scenes do not reset during play,
// tank variables are set as "missing", which Unity does not count as null/empty.
objectOwner = null;
playerController = null;
}
}
}