![]() The Unity docs also state that "Network.DestroyPlayerObjects() " should only be called by the server, not by individual players to clean up their own spawned items (like projectiles), so to work in it's current state as a way to clean up players, it should probably be used in conjunction with the NetworkIsServer action, though I haven't actually tested this last bit out yet. ![]() A more precise label would be "NetworkDestroyGroupID". Since you can use it to filter messages, one could set projectiles to one groupID, effects to another, players to another, and so on. There are other reasons why someone would want to manually change the groupID. As stated previously, it just looks for anything with a particular groupID. This is not what happens.)Īlthough "Network.DestroyPlayerObjects() " implies that it cleans up after a player, that isn't necessarily how it works. ![]() It just says it removes "the" object specified by the user in the action. (The fogbugz page doesn't mention player cleanup. It works in the way the label (and also the associated fogbugz help page description) seems to be describing. There needs to be a second action correctly labeled "NetworkDestroy" or maybe "NetworkDestroyObject" that uses "Network.Destroy() " to only get rid of the object with the currently-selected view ID.įor now, in the NetworkDestroy.cs script in Playmaker>Actions>Network, if I change this:Ĭode: Network.Destroy() The "NetworkDestroy" action, as written, should really be labeled "NetworkDestroyPlayer" because that's what it's intended use is: cleaning up all objects created by a single player. Note that this is not the same as the network ID, which is dynamically assigned upon instantiation and is unique for every network ID in the scene. The groupID is always 0 by default unless the user manually changes it. The way this works is that it gets the groupID of the object and destroys everything in the scene with that groupID. The action script is using the latter: "Network.DestroyPlayerObjects() ". In Unity there are two commands for destroying networked objects: Okay, I've checked out the script for the Network Destroy action and found the problem.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |